From 3dce003dbceccbc1fb0bd54ea687d786fe724f63 Mon Sep 17 00:00:00 2001 From: Inom Date: Tue, 16 Nov 2021 20:55:10 +0300 Subject: 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. --- wee_slack.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'wee_slack.py') 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( -- cgit