commit 4433cc0

Hubert Hirtz  ·  2021-11-02 19:37:46 +0000 UTC
parent cd28b24
Ensure BATCH's first arg is not empty
1 files changed,  +4, -1
+4, -1
 1@@ -973,8 +973,11 @@ func (s *Session) handleRegistered(msg Message) (Event, error) {
 2 		if err := msg.ParseParams(&id); err != nil {
 3 			return nil, err
 4 		}
 5+		if len(id) == 0 {
 6+			return nil, fmt.Errorf("empty batch id")
 7+		}
 8 
 9-		batchStart := id[0] == '+' // id is not empty since it's not a trailing param
10+		batchStart := id[0] == '+'
11 		id = id[1:]
12 
13 		if batchStart {