When the history contains an entry like "git ", don't crash

This commit is contained in:
blinry 2020-11-02 15:39:12 +01:00
parent 664fefe2e5
commit 3a3baa54fa

View file

@ -138,7 +138,7 @@ func relevant_subcommands():
var result = {}
for h in game.state["history"]:
var parts = Array(h.split(" "))
if parts[0] == "git":
if parts.size() >= 2 and parts[0] == "git":
var subcommand = parts[1]
if git_commands.has(subcommand):
if not result.has(subcommand):