From 266057eeefe090054389a1980ffbf98315042ff5 Mon Sep 17 00:00:00 2001 From: Greg Hewgill Date: Fri, 9 Jan 2009 00:01:08 +1300 Subject: [PATCH] handle unexpected empty item --- ChangeLog | 1 + ljdump.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 183f4af..47a8778 100644 --- 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 diff --git a/ljdump.py b/ljdump.py index e7534a9..534e683 100755 --- 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) -- 2.39.5