Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

Less error-prone when the returned JSON isn't as predicted.

Steve Micallef765557084c24
diff --git a/modules/sfp_github.py b/modules/sfp_github.py
index eef9071d..3f42ff7a 100644
--- a/modules/sfp_github.py
+++ b/modules/sfp_github.py
@@ -99,18 +99,18 @@ class sfp_github(SpiderFootPlugin):
self.sf.debug("Error processing JSON response.")
return None
- if not json_data['login']:
+ if not json_data.get('login'):
self.sf.debug(name + " is not a valid Github profile")
return None
- if not json_data['name']:
+ if not json_data.get('name'):
self.sf.debug(name + " is not a valid Github profile")
return None
e = SpiderFootEvent("RAW_RIR_DATA", "Possible full name: " + json_data['name'], self.__name__, event)
self.notifyListeners(e)
- location = json_data['location']
+ location = json_data.get('location')
if location is None:
return None