Merge pull request #7 from l33twolf/master

fix crash in syntax error
pull/1/head
Yusuke Shinyama 2011-09-30 06:58:24 -07:00
commit 9fc37d6dbe
1 changed files with 4 additions and 1 deletions

View File

@ -454,7 +454,10 @@ class PDFDocument(object):
try:
obj = objs[i]
except IndexError:
raise PDFSyntaxError('Invalid object number: objid=%r' % (objid))
if STRICT:
raise PDFSyntaxError('Invalid object number: objid=%r' % (objid))
# return None for an invalid object number
return None
if isinstance(obj, PDFStream):
obj.set_objid(objid, 0)
else: