Skip to content

Commit fe00d61

Browse files
committed
Bug 38240148 - [38239257->25.03.3] SafeAsyncNamedCache.ensureRunningNamedCache() can throw a NPE
(merge ce/main -> ce/25.03 117750) [git-p4: depot-paths = "//dev/coherence-ce/release/coherence-ce-v25.03/": change = 117751]
1 parent 99734c1 commit fe00d61

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

prj/coherence-core-components/src/main/java/com/tangosol/coherence/component/util/SafeAsyncNamedCache.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/*
3-
* Copyright (c) 2000, 2023, Oracle and/or its affiliates.
3+
* Copyright (c) 2000, 2025, Oracle and/or its affiliates.
44
*
55
* Licensed under the Universal Permissive License v 1.0 as shown at
66
* https://oss.oracle.com/licenses/upl.
@@ -460,11 +460,8 @@ public void ensureLocked()
460460

461461
public com.tangosol.net.AsyncNamedCache ensureRunningNamedCache()
462462
{
463-
// import com.tangosol.net.AsyncNamedCache;
464-
// import com.tangosol.net.NamedCache;
465-
466463
AsyncNamedCache asyncCache = getInternalNamedCache();
467-
NamedCache cache = asyncCache.getNamedCache();
464+
NamedCache cache = asyncCache == null ? null : asyncCache.getNamedCache();
468465
SafeService serviceSafe = getSafeCacheService();
469466

470467
if (serviceSafe == null || !serviceSafe.isRunning() ||
@@ -480,7 +477,7 @@ public com.tangosol.net.AsyncNamedCache ensureRunningNamedCache()
480477
try
481478
{
482479
asyncCache = getInternalNamedCache();
483-
cache = asyncCache.getNamedCache();
480+
cache = asyncCache == null ? null : asyncCache.getNamedCache();
484481
serviceSafe = getSafeCacheService();
485482
if (serviceSafe == null || !serviceSafe.isRunning() ||
486483
cache == null || !cache.isActive() || !isStarted())

0 commit comments

Comments
 (0)