diff --git a/detox/android/detox/src/main/java/com/wix/detox/DetoxManager.java b/detox/android/detox/src/main/java/com/wix/detox/DetoxManager.java index 8a460f0883..5fbd116e00 100644 --- a/detox/android/detox/src/main/java/com/wix/detox/DetoxManager.java +++ b/detox/android/detox/src/main/java/com/wix/detox/DetoxManager.java @@ -86,7 +86,9 @@ public void run() { stopping = true; ReactNativeSupport.currentReactContext = null; ReactNativeSupport.removeEspressoIdlingResources(reactNativeHostHolder); - wsClient.close(); + if (wsClient != null) { + wsClient.close(); + } Looper.myLooper().quit(); } });