Explorar el Código

Return nil if no error in GetXrayErr

Added a check to return nil immediately if p.GetErr() returns nil in GetXrayErr, preventing further error handling when no error is present.
MHSanaei hace 1 día
padre
commit
8098d2b1b1
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      web/service/xray.go

+ 3 - 0
web/service/xray.go

@@ -40,6 +40,9 @@ func (s *XrayService) GetXrayErr() error {
 	}
 
 	err := p.GetErr()
+	if err == nil {
+		return nil
+	}
 
 	if runtime.GOOS == "windows" && err.Error() == "exit status 1" {
 		// exit status 1 on Windows means that Xray process was killed