Skip to content

Commit

Permalink
sfp_ipapico: return if no results are found (smicallef#1177)
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoles committed Jun 22, 2021
1 parent 3d8b605 commit 64a2f82
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/sfp_ipapico.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,15 @@ def handleEvent(self, event):
if eventData in self.results:
self.sf.debug(f"Skipping {eventData}, already checked.")
return None
else:
self.results[eventData] = True

self.results[eventData] = True

data = self.query(eventData)

if data is None:
self.sf.info("No results returned from ipapi.co")
return None

if data.get('country'):
location = ', '.join(filter(None, [data.get('city'), data.get('region'), data.get('region_code'), data.get('country_name'), data.get('country')]))
evt = SpiderFootEvent('GEOINFO', location, self.__name__, event)
Expand Down

0 comments on commit 64a2f82

Please sign in to comment.