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: try:
obj = objs[i] obj = objs[i]
except IndexError: 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): if isinstance(obj, PDFStream):
obj.set_objid(objid, 0) obj.set_objid(objid, 0)
else: else: