From 7a039d5407a0345bdd6cb3c2cec154b4455d003c Mon Sep 17 00:00:00 2001 From: blagoev Date: Tue, 3 Oct 2017 00:23:31 +0300 Subject: [PATCH] fix RN debugging on Android --- .../src/main/java/io/realm/react/RealmReactModule.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/react-native/android/src/main/java/io/realm/react/RealmReactModule.java b/react-native/android/src/main/java/io/realm/react/RealmReactModule.java index 0ad49a2a..18dc5d1f 100644 --- a/react-native/android/src/main/java/io/realm/react/RealmReactModule.java +++ b/react-native/android/src/main/java/io/realm/react/RealmReactModule.java @@ -158,6 +158,11 @@ class RealmReactModule extends ReactContextBaseJavaModule { e.printStackTrace(); } final String json = map.get("postData"); + if (json == null) { + Response response = newFixedLengthResponse(""); + response.addHeader("Access-Control-Allow-Origin", "http://localhost:8081"); + return response; + } final String jsonResponse = processChromeDebugCommand(cmdUri, json); Response response = newFixedLengthResponse(jsonResponse);