Skip to content

Commit 061af57

Browse files
authored
Merge pull request #145 from hexmode/fix-naked-slash
Make sure there is a command_part to get before getting it
2 parents a2d19bb + e8d9811 commit 061af57

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

npcsh/shell_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1795,8 +1795,8 @@ def execute_slash_command(
17951795
log_action("Command Executed", command)
17961796

17971797
command_parts = command.split()
1798-
command_name = command_parts[0]
1799-
args = command_parts[1:]
1798+
command_name = command_parts[0] if len(command_parts) >= 1 else None
1799+
args = command_parts[1:] if len(command_parts) >= 1 else []
18001800

18011801
current_npc = npc
18021802
if command_name in valid_npcs:

0 commit comments

Comments
 (0)