aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInom <inomoz@users.noreply.github.com>2021-11-16 20:55:10 +0300
committerGitHub <noreply@github.com>2021-11-16 18:55:10 +0100
commit3dce003dbceccbc1fb0bd54ea687d786fe724f63 (patch)
treeab78cf6cd3b840bae2a625ff1975c3bf183857e6
parent45f1394c9f2ac0404d715a334bdfcbc388fabcd1 (diff)
downloadwee-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.py6
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(