OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** @suppress {duplicate} */ | 7 /** @suppress {duplicate} */ |
8 var remoting = remoting || {}; | 8 var remoting = remoting || {}; |
9 | 9 |
10 /** @constructor */ | 10 /** @constructor */ |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 function onConfig(configStr) { | 312 function onConfig(configStr) { |
313 var config = /** @type {Object.<string,string>} */ JSON.parse(configStr); | 313 var config = /** @type {Object.<string,string>} */ JSON.parse(configStr); |
314 if (typeof config['host_id'] == 'string') { | 314 if (typeof config['host_id'] == 'string') { |
315 var hostId = config['host_id']; | 315 var hostId = config['host_id']; |
316 that.setHost(hostList.getHostForId(hostId)); | 316 that.setHost(hostList.getHostForId(hostId)); |
317 } else { | 317 } else { |
318 that.setHost(null); | 318 that.setHost(null); |
319 } | 319 } |
320 onDone(); | 320 onDone(); |
321 }; | 321 }; |
322 this.plugin_.getDaemonConfig(onConfig); | 322 try { |
323 this.plugin_.getDaemonConfig(onConfig); | |
324 } catch (err) { | |
325 this.setHost(null); | |
326 onDone(); | |
Wez
2012/04/24 02:17:21
nit: You could just onConfig('{}') here.
| |
327 } | |
323 }; | 328 }; |
324 | 329 |
325 /** @type {remoting.HostController} */ | 330 /** @type {remoting.HostController} */ |
326 remoting.hostController = null; | 331 remoting.hostController = null; |
OLD | NEW |