Skip to content

Commit 415941a

Browse files
hdurand0710mjuraga
authored andcommitted
BUG/MINOR: avoid panic in runtime Reload if output is empty
1 parent d462419 commit 415941a

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
@@ -176,7 +176,9 @@ func (c *client) Reload() (string, error) {
176176
parts := strings.SplitN(output, "\n--\n", 2)
177177
if len(parts) == 1 {
178178
// No startup logs. This happens when HAProxy is compiled without USE_SHM_OPEN.
179-
status = output[:len(output)-1]
179+
if len(output) > 0 {
180+
status = output[:len(output)-1]
181+
}
180182
} else {
181183
status, logs = parts[0], parts[1]
182184
}

0 commit comments

Comments
 (0)