Skip to content

Commit

Permalink
[skip ci] Check if the value is null before toInt (#1129)
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard20181 authored Nov 12, 2023
1 parent 5526fa2 commit 8a298bb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/ksubot.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@


BOT_TOKEN = os.environ.get("BOT_TOKEN")
CHAT_ID = int(os.environ.get("CHAT_ID"))
MESSAGE_THREAD_ID = int(os.environ.get("MESSAGE_THREAD_ID"))
CHAT_ID = os.environ.get("CHAT_ID")
MESSAGE_THREAD_ID = os.environ.get("MESSAGE_THREAD_ID")
COMMIT_URL = os.environ.get("COMMIT_URL")
COMMIT_MESSAGE = os.environ.get("COMMIT_MESSAGE")
RUN_URL = os.environ.get("RUN_URL")
Expand Down Expand Up @@ -47,6 +47,8 @@ def check_environ():
if CHAT_ID is None:
print("[-] Invalid CHAT_ID")
exit(1)
else:
CHAT_ID = int(CHAT_ID)
if COMMIT_URL is None:
print("[-] Invalid COMMIT_URL")
exit(1)
Expand All @@ -62,6 +64,11 @@ def check_environ():
if VERSION is None:
print("[-] Invalid VERSION")
exit(1)
if MESSAGE_THREAD_ID is None:
print("[-] Invaild MESSAGE_THREAD_ID")
exit(1)
else:
MESSAGE_THREAD_ID = int(MESSAGE_THREAD_ID)


async def main():
Expand Down

0 comments on commit 8a298bb

Please sign in to comment.