Skip to content

Commit f631343

Browse files
committed
BUG/MINOR: avoid panic in runtime Reload if output is empty
1 parent 9236295 commit f631343

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

runtime/runtime_client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ func (c *client) Reload() (string, error) {
186186
parts := strings.SplitN(output, "\n--\n", 2)
187187
if len(parts) == 1 {
188188
// No startup logs. This happens when HAProxy is compiled without USE_SHM_OPEN.
189-
status = output[:len(output)-1]
189+
if len(output) > 0 {
190+
status = output[:len(output)-1]
191+
}
190192
} else {
191193
status, logs = parts[0], parts[1]
192194
}

0 commit comments

Comments
 (0)