!wa: handle empty success response

Fixes #145
This commit is contained in:
gammafn 2021-04-27 06:26:28 -05:00
parent ce0b9a7ccd
commit fb20033900
1 changed files with 6 additions and 2 deletions

View File

@ -70,9 +70,13 @@ class MatrixModule(BotModule):
primary = None primary = None
fallback = None fallback = None
pods = res.get('pod')
if not pods:
return (('<em>(data not available)</em>', '(data not available)'), ) * 2
# workaround for bug(?) in upstream wa package # workaround for bug(?) in upstream wa package
if hasattr(res['pod'], 'get'): if hasattr(pods, 'get'):
res['pod'] = [res['pod']] pods = [pods]
for pod in res['pod']: for pod in res['pod']:
pod_htmls = [] pod_htmls = []
pod_texts = [] pod_texts = []