Skip to content

Commit 5dba9c8

Browse files
authored
Merge pull request #12 from Voyz/fix/data-news-on-init
don't assume data_news() will return a valid dict
2 parents d8f0ec6 + 630ff13 commit 5dba9c8

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)