Index: remoting/webapp/crd/js/host_list.js |
diff --git a/remoting/webapp/crd/js/host_list.js b/remoting/webapp/crd/js/host_list.js |
index e9e878dc3e27474aab64cf0c40ec24ee87b2b8eb..45229051daf795d4c2dfc115bbcd9c8164185649 100644 |
--- a/remoting/webapp/crd/js/host_list.js |
+++ b/remoting/webapp/crd/js/host_list.js |
@@ -109,8 +109,10 @@ remoting.HostList.prototype.load = function(onDone) { |
var storeHostList = function(items) { |
if (items[remoting.HostList.HOSTS_KEY]) { |
var cached = base.jsonParseSafe(items[remoting.HostList.HOSTS_KEY]); |
- if (cached) { |
- that.hosts_ = /** @type {Array<remoting.Host>} */ (cached); |
+ if (cached && cached instanceof Array) { |
+ that.hosts_ = cached |
+ .map((host) => remoting.Host.fromObject(host)) |
+ .filter((host) => Boolean(host)); |
} else { |
console.error('Invalid value for ' + remoting.HostList.HOSTS_KEY); |
} |