This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new d6da27c493 Avoid possible NPE
d6da27c493 is described below
commit d6da27c493042275bcc06650e648bc7882a5f827
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]