From 53380e6e7d5fc738701fc7983f95dfa5983bed95 Mon Sep 17 00:00:00 2001 From: James Perkins Date: Mon, 8 Jun 2020 08:56:27 -0700 Subject: [PATCH] [LOGMGR-276] Ensure the file is not null before attempting to rotate it. https://issues.redhat.com/browse/LOGMGR-276 --- .../logmanager/ext/handlers/PeriodicRotatingFileHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ext/src/main/java/org/jboss/logmanager/ext/handlers/PeriodicRotatingFileHandler.java b/ext/src/main/java/org/jboss/logmanager/ext/handlers/PeriodicRotatingFileHandler.java index f54a2626..e714975c 100644 --- a/ext/src/main/java/org/jboss/logmanager/ext/handlers/PeriodicRotatingFileHandler.java +++ b/ext/src/main/java/org/jboss/logmanager/ext/handlers/PeriodicRotatingFileHandler.java @@ -197,6 +197,10 @@ SuffixRotator getSuffixRotator() { private void rollOver() { try { final File file = getFile(); + if (file == null) { + // no file is set; a direct output stream or writer was specified + return; + } // first, close the original file (some OSes won't let you move/rename a file that is open) setFileInternal(null); // next, rotate it