Browse Source

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

Jacky 1 month ago
parent
commit
f0b25b6772
1 changed files with 3 additions and 0 deletions
  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()}, " ")
 }