Skip to content

Commit 630ff13

Browse files
authored
don't assume data_news() will return a valid dict
fixes #8 #10
1 parent d8f0ec6 commit 630ff13

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ibw/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ def _set_server(self) -> bool:
199199
)
200200

201201
# TO DO: Add check market hours here and then check for a mutual fund.
202-
if 'news' in self.data_news(conid='265598'):
202+
news = self.data_news(conid='265598')
203+
if news and 'news' in news:
203204
print(success)
204205
return True
205206
if server_account_content is not None and 'set' in server_update_content.keys() and server_update_content['set'] == True:

0 commit comments

Comments
 (0)