mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2024-11-20 16:20:18 +01:00
When the history contains an entry like "git ", don't crash
This commit is contained in:
parent
664fefe2e5
commit
3a3baa54fa
1 changed files with 1 additions and 1 deletions
|
@ -138,7 +138,7 @@ func relevant_subcommands():
|
||||||
var result = {}
|
var result = {}
|
||||||
for h in game.state["history"]:
|
for h in game.state["history"]:
|
||||||
var parts = Array(h.split(" "))
|
var parts = Array(h.split(" "))
|
||||||
if parts[0] == "git":
|
if parts.size() >= 2 and parts[0] == "git":
|
||||||
var subcommand = parts[1]
|
var subcommand = parts[1]
|
||||||
if git_commands.has(subcommand):
|
if git_commands.has(subcommand):
|
||||||
if not result.has(subcommand):
|
if not result.has(subcommand):
|
||||||
|
|
Loading…
Reference in a new issue