Fix check_json
The payload is sometimes a list
This commit is contained in:
@@ -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,
|
||||||
|
Reference in New Issue
Block a user