Skip to content

Commit 71b0ce2

Browse files
committed
Fixed 'hello' command handler to gracefully handle empty command
Fix #32
1 parent e17909b commit 71b0ce2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

discovery.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ func (d *Server) Run(in io.Reader, out io.Writer) error {
132132

133133
switch cmd {
134134
case "HELLO":
135-
d.hello(fullCmd[6:])
135+
if len(fullCmd) < 7 {
136+
d.hello("")
137+
} else {
138+
d.hello(fullCmd[6:])
139+
}
136140
case "START":
137141
d.start()
138142
case "LIST":

0 commit comments

Comments
 (0)