diff options
author | Inom <inomoz@users.noreply.github.com> | 2021-11-16 20:55:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 18:55:10 +0100 |
commit | 3dce003dbceccbc1fb0bd54ea687d786fe724f63 (patch) | |
tree | ab78cf6cd3b840bae2a625ff1975c3bf183857e6 | |
parent | 45f1394c9f2ac0404d715a334bdfcbc388fabcd1 (diff) | |
download | wee-slack-3dce003dbceccbc1fb0bd54ea687d786fe724f63.tar.gz |
Validate token not empty, before initiate connection (#853)
I continuously received this error:
```
AttributeError: 'NoneType' object has no attribute 'token'
```
Because tokens list was `['', '']`. And wee-chat tried initiate connections without tokens.
This small change fix this error.
-rw-r--r-- | wee_slack.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index 9d2e170..13eac0a 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -6750,7 +6750,11 @@ if __name__ == "__main__": auto_connect = weechat.info_get("auto_connect", "") != "0" if auto_connect: - tokens = [token.strip() for token in config.slack_api_token.split(",")] + tokens = [ + token.strip() + for token in config.slack_api_token.split(",") + if token + ] w.prnt( "", "Connecting to {} slack team{}.".format( |