Skip to content

Commit f43efc9

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

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

runtime/runtime_client.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ func (c *client) Reload() (string, error) {
170170
parts := strings.SplitN(output, "\n--\n", 2)
171171
if len(parts) == 1 {
172172
// No startup logs. This happens when HAProxy is compiled without USE_SHM_OPEN.
173-
status = output[:len(output)-1]
173+
if len(output) > 0 {
174+
status = output[:len(output)-1]
175+
}
174176
} else {
175177
status, logs = parts[0], parts[1]
176178
}

0 commit comments

Comments
 (0)