Explorar el Código

fix(nginx): handle nil stdErr in GetOutput method #1056

Jacky hace 2 meses
padre
commit
f0b25b6772
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      internal/nginx/control.go

+ 3 - 0
internal/nginx/control.go

@@ -50,6 +50,9 @@ func (t *ControlResult) RespError(c *gin.Context) {
 }
 
 func (t *ControlResult) GetOutput() string {
+	if t.stdErr == nil {
+		return t.stdOut
+	}
 	return strings.Join([]string{t.stdOut, t.stdErr.Error()}, " ")
 }