Fix check_json

The payload is sometimes a list
This commit is contained in:
Mads Marquart
2019-05-01 23:49:29 +02:00
parent d244856b41
commit f689376830

View File

@@ -193,7 +193,7 @@ def generateOfflineThreadingID():
def check_json(j): def check_json(j):
if j.get("payload") and j["payload"].get("error"): if hasattr(j.get("payload"), "get") and j["payload"].get("error"):
raise FBchatFacebookError( raise FBchatFacebookError(
"Error when sending request: {}".format(j["payload"]["error"]), "Error when sending request: {}".format(j["payload"]["error"]),
fb_error_code=None, fb_error_code=None,