Skip to content

Commit

Permalink
don't assume response is a dict (it can be a bool)
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperp committed Jun 15, 2011
1 parent a7e8934 commit d1960ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion facebook/__init__.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def request(self, path, args=None, post_args=None):
response = _parse_json(file.read()) response = _parse_json(file.read())
finally: finally:
file.close() file.close()
if response.get("error"): if isinstance(response, dict) and response.get("error"):
raise GraphAPIError(response["error"]["type"], raise GraphAPIError(response["error"]["type"],
response["error"]["message"]) response["error"]["message"])
return response return response
Expand Down

0 comments on commit d1960ab

Please sign in to comment.