Index: remoting/webapp/host_controller.js |
diff --git a/remoting/webapp/host_controller.js b/remoting/webapp/host_controller.js |
index 80870ac79f495f60c033fe08ff3ff3b28876e026..750212ed97f96147bb08e124fe3a2ebe48431ed2 100644 |
--- a/remoting/webapp/host_controller.js |
+++ b/remoting/webapp/host_controller.js |
@@ -244,13 +244,13 @@ remoting.HostController.prototype.stop = function(callback) { |
* @return {Object.<string,string>|null} The host configuration. |
*/ |
function parseHostConfig_(configStr) { |
- try { |
- var config = /** @type {Object.<string,string>} */ JSON.parse(configStr); |
- if (typeof config['host_id'] == 'string' && |
- typeof config['xmpp_login'] == 'string') { |
- return config; |
- } |
- } catch (err) { |
+ var config = /** @type {Object.<string,string>} */ jsonParseSafe(configStr); |
+ if (config && |
+ typeof config['host_id'] == 'string' && |
+ typeof config['xmpp_login'] == 'string') { |
+ return config; |
+ } else { |
+ console.error('Invalid getDaemonConfig response.'); |
} |
return null; |
} |