Browse Source

fix null pointer

liuwangsheng01 8 years ago
parent
commit
88c815fa44
1 changed files with 1 additions and 1 deletions
  1. 1 1
      wxbot.py

+ 1 - 1
wxbot.py

@@ -493,7 +493,7 @@ class WXBot:
                 print '    | desc: %s' % self.search_content('des', content, 'xml')
                 print '    | link: %s' % msg['Url']
                 print '    | from: %s' % self.search_content('appname', content, 'xml')
-                print '    | content: %s' % msg.get('content')[:20]
+                print '    | content: %s' % (msg.get('content')[:20] if msg.get('content') else "unknown")
                 print '    --------------------------'
 
         elif mtype == 62: