Skip to content

Commit ac91828

Browse files
authored
fix(shell): crash when completing map of object (#2845)
1 parent 6bf91b1 commit ac91828

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/core/shell.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func sortOptions(meta *meta, args []string, toSuggest string, suggestions []stri
158158
}
159159

160160
sort.Slice(argSpecs, func(i, j int) bool {
161-
if argSpecs[i].Arg.Required != argSpecs[j].Arg.Required {
161+
if argSpecs[i].Arg != nil && argSpecs[j].Arg != nil && argSpecs[i].Arg.Required != argSpecs[j].Arg.Required {
162162
return argSpecs[i].Arg.Required
163163
}
164164
return argSpecs[i].Text < argSpecs[j].Text

0 commit comments

Comments
 (0)