Index: remoting/webapp/client_plugin_async.js |
diff --git a/remoting/webapp/client_plugin_async.js b/remoting/webapp/client_plugin_async.js |
index b0baec36d3deda87223cafb2130698777b9b3dbd..43b111022a465b71e08b22999bbe74fd69418b87 100644 |
--- a/remoting/webapp/client_plugin_async.js |
+++ b/remoting/webapp/client_plugin_async.js |
@@ -87,11 +87,11 @@ remoting.ClientPluginAsync.prototype.API_MIN_VERSION_ = 5; |
/** |
* @param {string} message_str Message from the plugin. |
*/ |
-remoting.ClientPluginAsync.prototype.handleMessage_ = function(message_str) { |
+remoting.ClientPluginAsync.prototype.handleMessage_ = function(messageStr) { |
var message = /** @type {{method:string, data:Object.<string,string>}} */ |
- JSON.parse(message_str); |
+ jsonParseSafe(messageStr); |
- if (!('method' in message) || !('data' in message)) { |
+ if (!message || !('method' in message) || !('data' in message)) { |
console.error('Received invalid message from the plugin: ' + message_str); |
return; |
} |