diff --git a/hazelcast/src/test/java/com/hazelcast/test/TestNodeRegistry.java b/hazelcast/src/test/java/com/hazelcast/test/TestNodeRegistry.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/test/java/com/hazelcast/test/TestNodeRegistry.java
+++ b/hazelcast/src/test/java/com/hazelcast/test/TestNodeRegistry.java
@@ -259,11 +259,13 @@ public final class TestNodeRegistry {
             MockConnection conn = mapConnections.get(address);
             if (conn == null) {
                 NodeEngineImpl nodeEngine = nodes.get(address);
-                MockConnection thisConnection = new MockConnection(address, node.getThisAddress(), node.nodeEngine);
-                conn = new MockConnection(node.getThisAddress(), address, nodeEngine);
-                conn.localConnection = thisConnection;
-                thisConnection.localConnection = conn;
-                mapConnections.put(address, conn);
+                if (nodeEngine != null) {
+                    MockConnection thisConnection = new MockConnection(address, node.getThisAddress(), node.nodeEngine);
+                    conn = new MockConnection(node.getThisAddress(), address, nodeEngine);
+                    conn.localConnection = thisConnection;
+                    thisConnection.localConnection = conn;
+                    mapConnections.put(address, conn);
+                }
             }
             return conn;
         }
Null check node engine before creating MockConnection