Skip to content

Commit

Permalink
ARTEMIS-3816 Fix connection router null pointer dereferences
Browse files Browse the repository at this point in the history
  • Loading branch information
brusdev committed May 10, 2022
1 parent d433f3b commit 7a03f58
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public TargetResult getTarget(String key) {
return localTarget;
}

if (pool == null) {
if (policy == null || pool == null) {
return TargetResult.REFUSED_USE_ANOTHER_RESULT;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ private Policy deployPolicy(NamedPropertyConfiguration policyConfig, Pool pool)

policy.init(policyConfig.getProperties());

if (policy.getTargetProbe() != null) {
if (pool != null && policy.getTargetProbe() != null) {
pool.addTargetProbe(policy.getTargetProbe());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ public void start() {
if (persisted) {
persistedCacheEntries = storageManager.getPersistedKeyValuePairs(id);

for (Map.Entry<String, PersistedKeyValuePair> cacheEntry : persistedCacheEntries.entrySet()) {
cache.put(cacheEntry.getKey(), cacheEntry.getValue().getValue());
logger.info(cacheEntry.toString());
if (persistedCacheEntries != null) {
for (Map.Entry<String, PersistedKeyValuePair> cacheEntry : persistedCacheEntries.entrySet()) {
cache.put(cacheEntry.getKey(), cacheEntry.getValue().getValue());
logger.info(cacheEntry.toString());
}
}
}

Expand Down

0 comments on commit 7a03f58

Please sign in to comment.