mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-22 07:37:23 +00:00
Bugfix: Empty command crashes the program #9
This commit is contained in:
3
main.go
3
main.go
@ -632,6 +632,9 @@ func handleInput(viewName string) error {
|
|||||||
}
|
}
|
||||||
if strings.HasPrefix(inputString, cmdPrefix) {
|
if strings.HasPrefix(inputString, cmdPrefix) {
|
||||||
cmd := delete_empty(strings.Split(inputString[len(cmdPrefix):], " "))
|
cmd := delete_empty(strings.Split(inputString[len(cmdPrefix):], " "))
|
||||||
|
if len(cmd) < 1 {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
if c, ok := commands[cmd[0]]; ok {
|
if c, ok := commands[cmd[0]]; ok {
|
||||||
c.Exec(cmd)
|
c.Exec(cmd)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user