]> wagner.pp.ru Git - oss/ljdump.git/commitdiff
handle unexpected empty item
authorGreg Hewgill <greg@hewgill.com>
Thu, 8 Jan 2009 11:01:08 +0000 (00:01 +1300)
committerGreg Hewgill <greg@hewgill.com>
Thu, 8 Jan 2009 11:11:10 +0000 (00:11 +1300)
ChangeLog
ljdump.py

index 183f4afea288c6abcbd80f1c0b63548668c1eb83..47a8778d4d50c4a859ef04622b778366fa7ce452 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@ Version 1.3.1 - 2009-01-08
 
 - Handle userpic keywords with non-ASCII characters
 - Download and save userpic images
+- Handle unexpected empty item
 
 Version 1.2 - 2006-09-08
 
index e7534a91b83f940f69321a0142c743069eb2adb0..534e68382fe813f72e6947e0a86bfdac10590caa 100755 (executable)
--- a/ljdump.py
+++ b/ljdump.py
@@ -190,8 +190,12 @@ while True:
                     'selecttype': "one",
                     'itemid': item['item'][2:],
                 }, Password))
-                writedump("%s/%s" % (Username, item['item']), e['events'][0])
-                newentries += 1
+                if e['events']:
+                    writedump("%s/%s" % (Username, item['item']), e['events'][0])
+                    newentries += 1
+                else:
+                    print "Unexpected empty item: %s" % item['item']
+                    errors += 1
             except xmlrpclib.Fault, x:
                 print "Error getting item: %s" % item['item']
                 pprint.pprint(x)