From 18eb8eb605a08f1a6851e9524cfcba921d65159c Mon Sep 17 00:00:00 2001 From: Badiboy Date: Wed, 19 Aug 2020 23:57:48 +0300 Subject: [PATCH] Two None checks --- telebot/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/telebot/util.py b/telebot/util.py index 7612ec4..67c6abf 100644 --- a/telebot/util.py +++ b/telebot/util.py @@ -191,6 +191,7 @@ def is_command(text): :param text: Text to check. :return: True if `text` is a command, else False. """ + if (text is None): return None return text.startswith('/') @@ -208,6 +209,7 @@ def extract_command(text): :param text: String to extract the command from :return: the command if `text` is a command (according to is_command), else None. """ + if (text is None): return None return text.split()[0].split('@')[0][1:] if is_command(text) else None