mlapilla / jsunpack-n

Automatically exported from code.google.com/p/jsunpack-n
GNU General Public License v2.0
0 stars 0 forks source link

AttributeError in pdf.py due to unchecked regex return #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Lines 320 and 334 in pdf.py both contain the code:

streamLocation = re.search(....);

In both cases, the return value is unchecked.  In the case where no match is 
found this leads to a fatal AttributeError on the following line when 
streamLocation.start() is accessed.

Suggest adding an 'if streamLocation:' check in both cases to allow the script 
to continue.

Original issue reported on code.google.com by shanecar...@gmail.com on 8 Aug 2014 at 6:26