fixed error when payload is null

This commit is contained in:
RemixDev 2021-12-22 13:37:34 +01:00
parent 90ebf8693b
commit 63618bfc8c
No known key found for this signature in database
GPG key ID: B33962B465BDB51C

View file

@ -75,7 +75,7 @@ class GW:
sleep(2)
return self.api_call(method, args, params)
if len(result_json['error']):
if result_json.get('payload', {}).get('FALLBACK', {}):
if result_json.get('payload', {}) and result_json['payload'].get('FALLBACK', {}):
for key in result_json['payload']['FALLBACK'].keys():
args[key] = result_json['payload']['FALLBACK'][key]
return self.api_call(method, args, params)