Skip to content

Commit

Permalink
Don't crash on malformed integer in iPhoto plist
Browse files Browse the repository at this point in the history
Simply default to 0. Fixes arsenetar#214.
  • Loading branch information
Virgil Dupras committed Mar 15, 2014
1 parent 95c6a7d commit 4cafeaf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core_pe/iphoto_plist.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ def __init__(self):
def getData(self):
self.lastdata = plistlib.PlistParser.getData(self)
return self.lastdata

def end_integer(self):
try:
self.addObject(int(self.getData()))
except ValueError:
self.addObject(0)

0 comments on commit 4cafeaf

Please sign in to comment.