command_name null check before calling .lower()

fixes #534

`AttributeError: 'NoneType' object has no attribute 'lower'`
This commit is contained in:
Chris Cheney
2023-04-08 21:30:36 -05:00
committed by GitHub
parent 1ea9c36571
commit aa786e1b41

View File

@@ -358,7 +358,7 @@ while True:
f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}") f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}")
# Execute command # Execute command
if command_name.lower() == "error": if command_name is not None and command_name.lower() == "error":
result = f"Command {command_name} threw the following error: " + arguments result = f"Command {command_name} threw the following error: " + arguments
elif command_name == "human_feedback": elif command_name == "human_feedback":
result = f"Human feedback: {user_input}" result = f"Human feedback: {user_input}"