Skip to content

Commit

Permalink
Fixed 'hello' command handler to gracefully handle empty command
Browse files Browse the repository at this point in the history
Fix #32
  • Loading branch information
cmaglie committed Feb 22, 2023
1 parent e17909b commit 71b0ce2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ func (d *Server) Run(in io.Reader, out io.Writer) error {

switch cmd {
case "HELLO":
d.hello(fullCmd[6:])
if len(fullCmd) < 7 {
d.hello("")
} else {
d.hello(fullCmd[6:])
}
case "START":
d.start()
case "LIST":
Expand Down

0 comments on commit 71b0ce2

Please sign in to comment.