Fix panic when entering empty command (fix #13)

This commit is contained in:
Manfred Touron 2017-12-15 13:55:53 +01:00
parent a413aa86c2
commit 7ed60f6908
2 changed files with 4 additions and 1 deletions

View file

@ -2,7 +2,7 @@
## master (unreleased)
* No entry
* Fix panic when entering empty command (fix [#13](https://github.com/moul/sshportal/issues/13))
## v1.6.0 (2017-12-12)

View file

@ -1918,6 +1918,9 @@ GLOBAL OPTIONS:
if len(words) == 1 && strings.ToLower(words[0]) == "exit" {
return s.Exit(0)
}
if len(words) == 0 {
continue
}
NewEvent("shell", words[0]).SetAuthor(&myself).SetArg("interactive", true).SetArg("args", words[1:]).Log(db)
if err := app.Run(append([]string{"config"}, words...)); err != nil {
if cliErr, ok := err.(*cli.ExitError); ok {