mirror of
https://github.com/laramies/theHarvester.git
synced 2024-11-10 17:13:07 +08:00
Merge pull request #157 from NotoriousRebel/master
Added error check to duckduckgo to make sure it doesn't crash
This commit is contained in:
commit
759992d6a1
2 changed files with 4 additions and 2 deletions
|
@ -48,9 +48,11 @@ def crawl(self, text):
|
|||
load = json.loads(text)
|
||||
for key in load.keys(): # Iterate through keys of dict.
|
||||
val = load.get(key)
|
||||
if isinstance(val, int) or isinstance(val, dict):
|
||||
if isinstance(val, int) or isinstance(val, dict) or val is None:
|
||||
continue
|
||||
if isinstance(val, list):
|
||||
if len(val) == 0: # Make sure not indexing an empty list
|
||||
continue
|
||||
val = val[0] # First value should be dict.
|
||||
if isinstance(val, dict): # Sanity check.
|
||||
for key in val.keys():
|
||||
|
|
|
@ -922,4 +922,4 @@ def start(argv):
|
|||
except Exception:
|
||||
import traceback
|
||||
print(traceback.print_exc())
|
||||
sys.exit(1)
|
||||
sys.exit(1)
|
Loading…
Reference in a new issue