Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(282)

Unified Diff: remoting/webapp/host_settings.js

Issue 305393003: Fix Chromoting client startup warnings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add {} around return for consistency. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/webapp/client_session.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/host_settings.js
diff --git a/remoting/webapp/host_settings.js b/remoting/webapp/host_settings.js
index 9fa43b690bd02da1d9cf6f7528cbf81c1f36f86a..c2dee6286371008e7e54b5c9d76962f81f6da2b7 100644
--- a/remoting/webapp/host_settings.js
+++ b/remoting/webapp/host_settings.js
@@ -81,14 +81,17 @@ remoting.HostSettings.loadInternal_ = function(hostId, callback) {
var onDone = function(allHosts) {
var result = {};
try {
- result = jsonParseSafe(allHosts[remoting.HostSettings.KEY_]);
- if (typeof(result) != 'object') {
- console.error("Error loading host settings: Not an object");
- result = {};
- } else if (/** @type {Object} */ (result).hasOwnProperty(hostId) &&
- typeof(result[hostId]) == 'object') {
- callback(result[hostId], result);
- return;
+ var hosts = allHosts[remoting.HostSettings.KEY_];
+ if (hosts) {
+ result = jsonParseSafe(hosts);
+ if (typeof(result) != 'object') {
+ console.error("Error loading host settings: Not an object");
+ result = {};
+ } else if (/** @type {Object} */ (result).hasOwnProperty(hostId) &&
+ typeof(result[hostId]) == 'object') {
+ callback(result[hostId], result);
+ return;
+ }
}
} catch (err) {
var typedErr = /** @type {*} */ (err);
« no previous file with comments | « remoting/webapp/client_session.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698