mumixam / weechat-twitch

Checks status of streams using twitch api
31 stars 9 forks source link

Don't fail if there is no game_id #8

Closed mas90 closed 4 years ago

mas90 commented 4 years ago
22:51:40   weechat                  │ python: stdout/stderr (twitch): Traceback (most recent call last):
22:51:40   weechat                  │ python: stdout/stderr (twitch):   File "/home/malc/.weechat/python/twitch.py", line 220, in
                                    │ stream_api
22:51:40   weechat                  │ python: stdout/stderr (twitch):     if not game_id in gameid_cache:
22:51:40   weechat                  │ python: stdout/stderr (twitch): UnboundLocalError: local variable 'game_id' referenced before
                                    │ assignment
22:51:40   weechat              =!= │ python: error in function "stream_api"
mumixam commented 4 years ago

Thanks for the PR. Haven't seen this issue. Can you share the name of some streams where this happens? You can whisper me on twitch @ mum1xam or query me on freenode @ mumixam if you don't want to say in public

mas90 commented 4 years ago

Can you share the name of some streams where this happens?

I've been using this script for years, and this error happened once :-) It was a loadingreadyrun stream ongoing when I opened the PR; it's unclear whether the broadcaster just hadn't set a game, or whether they did but the Twitch API wasn't reporting it due to a fault on their end.

Thanks for merging.