From 82f4f787f55891c1b79d161a9d0fabaf879209a2 Mon Sep 17 00:00:00 2001 From: Guillermo Orellana <172084+wiyarmir@users.noreply.github.com> Date: Tue, 10 Apr 2018 16:03:26 +0100 Subject: [PATCH] Nullcheck on stop() Avoid NPE when DetoxServerUrl and DetoxSessionId are undefined --- .../detox/src/main/java/com/wix/detox/DetoxManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); } });