Skip to content
Permalink
Browse files

Merge pull request #3752 from jamezp/WFCORE-4436

[WFCORE-4436] Ensure the TCCL is not null before doing the equals check.
  • Loading branch information
jmesnil committed Apr 24, 2019
2 parents d282885 + 2b59b22 commit 5b0e4736ae6d51c9f990ea41a2219dfc73c3ebad
Showing with 4 additions and 2 deletions.
  1. +4 −2 cli/src/main/java/org/jboss/as/cli/embedded/ThreadLocalContextSelector.java
@@ -69,7 +69,8 @@ void restore(Contexts toRestore) {
@Override
public StdioContext getStdioContext() {
// CLI loggers should only use the default stdio context regardless if the thread-local context is set.
if (WildFlySecurityManager.getCurrentContextClassLoaderPrivileged().equals(cliClassLoader)) {
final ClassLoader tccl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
if (tccl != null && tccl.equals(cliClassLoader)) {
return defaultContexts.getStdioContext();
}
Contexts threadContext = threadLocal.get();
@@ -81,7 +82,8 @@ public StdioContext getStdioContext() {
public LogContext getLogContext() {
// CLI loggers should only use the default stdio context regardless if the thread-local context is set This
// allows the context configured for CLI, e.g. jboss-cli-logging.properties.
if (WildFlySecurityManager.getCurrentContextClassLoaderPrivileged().equals(cliClassLoader)) {
final ClassLoader tccl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
if (tccl != null && tccl.equals(cliClassLoader)) {
return defaultContexts.getLogContext();
}
Contexts threadContext = threadLocal.get();

0 comments on commit 5b0e473

Please sign in to comment.
You can’t perform that action at this time.