Commit e5b485f7 authored by garykac@chromium.org's avatar garykac@chromium.org

Fix Chromoting client startup warnings.

This fixes 2 minor start warnings:
* On platforms that have no remapKeys, we used to report a 'bad remapKey'
  warning.
* If there are no hostsettings, then we used to report a 'Not an object'
  warning when trying to load the host settings.

Review URL: https://codereview.chromium.org/305393003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274472 0039d316-1c4b-4281-b951-d872f2087c98
parent c1bb22db
......@@ -718,6 +718,10 @@ remoting.ClientSession.prototype.applyRemapKeys_ = function(apply) {
remapKeys = '0x0700e4>0x0700e7';
}
if (remapKeys == '') {
return;
}
var remappings = remapKeys.split(',');
for (var i = 0; i < remappings.length; ++i) {
var keyCodes = remappings[i].split('>');
......
......@@ -81,7 +81,9 @@ remoting.HostSettings.loadInternal_ = function(hostId, callback) {
var onDone = function(allHosts) {
var result = {};
try {
result = jsonParseSafe(allHosts[remoting.HostSettings.KEY_]);
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 = {};
......@@ -90,6 +92,7 @@ remoting.HostSettings.loadInternal_ = function(hostId, callback) {
callback(result[hostId], result);
return;
}
}
} catch (err) {
var typedErr = /** @type {*} */ (err);
console.error('Error loading host settings:', typedErr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment