Bullet-proofing. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/7e7f53e9 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/7e7f53e9 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/7e7f53e9
Branch: refs/heads/LOG4J2-1349-gcfree-threadcontext Commit: 7e7f53e96c54ab9db3d0889e33ad70116d25858f Parents: 9ba97f2 Author: Gary Gregory <ggreg...@apache.org> Authored: Tue Sep 6 02:56:37 2016 -0400 Committer: Gary Gregory <ggreg...@apache.org> Committed: Tue Sep 6 02:56:37 2016 -0400 ---------------------------------------------------------------------- .../java/org/apache/logging/log4j/core/util/ExecutorServices.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/7e7f53e9/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java index efd7ed1..6b75a83 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/util/ExecutorServices.java @@ -45,7 +45,7 @@ public class ExecutorServices { * termination. */ public static boolean shutdown(ExecutorService executorService, long timeout, TimeUnit timeUnit, String source) { - if (executorService.isTerminated()) { + if (executorService == null || executorService.isTerminated()) { return true; } executorService.shutdown(); // Disable new tasks from being submitted