Skip to content
Permalink
Browse files

[WFCORE-4436] Ensure the TCCL is not null before doing the equals check.

  • Loading branch information
jamezp authored and jmesnil committed Apr 22, 2019
1 parent d282885 commit ed57553f8b7d465d1498545209ccf4e7623f6563
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 ed57553

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