diff --git a/hazelcast-client-legacy/src/main/java/com/hazelcast/client/proxy/NearCachedClientMapProxy.java b/hazelcast-client-legacy/src/main/java/com/hazelcast/client/proxy/NearCachedClientMapProxy.java
index <HASH>..<HASH> 100644
--- a/hazelcast-client-legacy/src/main/java/com/hazelcast/client/proxy/NearCachedClientMapProxy.java
+++ b/hazelcast-client-legacy/src/main/java/com/hazelcast/client/proxy/NearCachedClientMapProxy.java
@@ -389,6 +389,7 @@ public class NearCachedClientMapProxy<K, V> extends ClientMapProxy<K, V> {
 
             if (event instanceof CleaningNearCacheInvalidation) {
                 nearCache.clear();
+                return;
             }
 
             throw new IllegalArgumentException("Unexpected event received [" + event + ']');
fixed missing return in case of CleaningNearCacheInvalidation received at NearCachedClientMapProxy for legacy client