This is an automated email from the ASF dual-hosted git repository.

rmaucher pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new 4923214f4b Avoid possible NPE
4923214f4b is described below

commit 4923214f4b218ea9a37009a73436ebe34b38fad7
Author: remm <[email protected]>
AuthorDate: Wed May 20 09:59:35 2026 +0200

    Avoid possible NPE
---
 java/org/apache/catalina/ant/BaseRedirectorHelperTask.java | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java 
b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
index 7443bb3df3..1f6b30601b 100644
--- a/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
+++ b/java/org/apache/catalina/ant/BaseRedirectorHelperTask.java
@@ -299,7 +299,9 @@ public abstract class BaseRedirectorHelperTask extends Task 
{
     @Override
     protected void handleFlush(String output) {
         handleOutput(output);
-        redirectOutPrintStream.flush();
+        if (redirectOutput) {
+            redirectOutPrintStream.flush();
+        }
     }
 
 
@@ -332,7 +334,9 @@ public abstract class BaseRedirectorHelperTask extends Task 
{
     @Override
     protected void handleErrorFlush(String output) {
         handleErrorOutput(output);
-        redirectErrPrintStream.flush();
+        if (redirectOutput) {
+            redirectErrPrintStream.flush();
+        }
     }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to