From 26a028e98d5678818772a25f03d4a8343a32db9c Mon Sep 17 00:00:00 2001 From: James Ide Date: Mon, 31 Aug 2015 11:18:23 -0700 Subject: [PATCH] [RN Debugger] Don't try to handle messages without a method Summary: Some messages are special and are intended for the devtools, like `{$open: id}` and `{$error: id}`. The main debugger-ui page can't handle these and thinks something is wrong when `object.method` is undefined. This diff handles messages only if they specify a method. Fixes #2377 Closes https://github.com/facebook/react-native/pull/2405 Github Author: James Ide --- debugger.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/debugger.html b/debugger.html index 24f8aea5..3b905efe 100644 --- a/debugger.html +++ b/debugger.html @@ -85,6 +85,10 @@ function connectToDebuggerProxy() { ws.onmessage = function(message) { var object = JSON.parse(message.data); + if (!object.method) { + return; + } + var sendReply = function(result) { ws.send(JSON.stringify({replyID: object.id, result: result})); };