redhuntlabs / Octopii

An AI-powered Personal Identifiable Information (PII) scanner.
https://redhuntlabs.com/blog/octopii-an-opensource-pii-scanner-for-images.html
Other
631 stars 54 forks source link

Octopii crashes on empty files #17

Closed Elliott-Peak closed 1 year ago

Elliott-Peak commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior: Run octopii against a folder with a 0 byte file in it

Traceback (most recent call last): File "/opt/Octopii/octopii.py", line 199, in results = search_pii (file_path) File "/opt/Octopii/octopii.py", line 80, in search_pii addresses = text_utils.regional_pii(text) File "/opt/Octopii/text_utils.py", line 80, in regional_pii place_entity = locationtagger.find_locations(text = text) File "/usr/local/lib/python3.10/dist-packages/locationtagger/init.py", line 4, in find_locations e = NamedEntityExtractor(url=url, text=text) File "/usr/local/lib/python3.10/dist-packages/locationtagger/locationextractor.py", line 25, in init raise Exception('Please input any text or url') Exception: Please input any text or url

Expected behavior It not to crash when a file is 0 bytes

0x4f53 commented 1 year ago

Fixed in #18.