You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by mi...@apache.org on 2016/08/30 09:27:32 UTC

[15/24] logging-log4j2 git commit: Added missing null check for future in stop() because future could be null if there wasn't an log event before

Added missing null check for future in stop() because future could be null if there wasn't an log event before


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/d74f4b13
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/d74f4b13
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/d74f4b13

Branch: refs/heads/LOG4J2-1528
Commit: d74f4b13cad1ba3c11945afd4f0410f5ea03d29d
Parents: 040e29e
Author: Aleksey Zvolinsky <al...@zvolinsky.name>
Authored: Wed Jun 22 08:46:48 2016 +0300
Committer: Gary Gregory <gg...@apache.org>
Committed: Mon Aug 29 10:20:54 2016 -0700

----------------------------------------------------------------------
 .../logging/log4j/core/appender/routing/IdlePurgePolicy.java     | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/d74f4b13/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/IdlePurgePolicy.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/IdlePurgePolicy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/IdlePurgePolicy.java
index dacf993..5a5ee6a 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/IdlePurgePolicy.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/IdlePurgePolicy.java
@@ -60,7 +60,9 @@ public class IdlePurgePolicy extends AbstractLifeCycle implements PurgePolicy, R
     @Override
     public void stop() {
         super.stop();
-        future.cancel(true);
+        if(future != null) {
+            future.cancel(true);
+        }
     }
 
     /**