Skip to content

Commit

Permalink
fixed NPE that was caused by new interaction between Payara-internal …
Browse files Browse the repository at this point in the history
…webapps and MicroProfile
  • Loading branch information
lprimak committed Mar 26, 2021
1 parent 31d9093 commit aa2c6dc
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) [2016-2020] Payara Foundation and/or its affiliates. All rights reserved.
* Copyright (c) [2016-2021] Payara Foundation and/or its affiliates. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
Expand Down Expand Up @@ -146,11 +146,14 @@ private boolean isLoaded(String componentId, ComponentInvocation invocation) {
: compEnvMgr.getJndiNameEnvironment(componentId);
if (env != null) {
ApplicationInfo appInfo = appRegistry.get(DOLUtils.getApplicationFromEnv(env).getRegistrationName());
Collection<ModuleInfo> modules = appInfo.getModuleInfos();
String moduleName = DOLUtils.getModuleName(env);
if (modules.stream().filter(mod -> mod.getName().equals(moduleName))
.anyMatch(moduleInfo -> !moduleInfo.isLoaded())) {
return false;
if (appInfo != null) {
// Check if deployed vs. Payara internal application
Collection<ModuleInfo> modules = appInfo.getModuleInfos();
String moduleName = DOLUtils.getModuleName(env);
if (modules.stream().filter(mod -> mod.getName().equals(moduleName))
.anyMatch(moduleInfo -> !moduleInfo.isLoaded())) {
return false;
}
}
}
return env != null;
Expand Down

0 comments on commit aa2c6dc

Please sign in to comment.