Index: remoting/webapp/crd/js/options_export.js |
diff --git a/remoting/webapp/crd/js/options_export.js b/remoting/webapp/crd/js/options_export.js |
index dbd3a25560c96d3e8fa94fe1fceecc06561bc31e..392b043ee065a1045a777995ba0f2561abfb348f 100644 |
--- a/remoting/webapp/crd/js/options_export.js |
+++ b/remoting/webapp/crd/js/options_export.js |
@@ -20,11 +20,17 @@ remoting.OptionsExporter = function() { |
remoting.OptionsExporter.migrateSettings_ = function() { |
var result = new base.Deferred(); |
- chrome.storage.local.get('remoting-host-options', function(options) { |
+ chrome.storage.local.get(KEY_NAME, function(options) { |
+ // If there are no host options stored, reformat the message response so |
+ // that the sender doesn't interpret it as an error. |
+ if (Object.keys(options).length == 0) { |
+ options[KEY_NAME] = '{}'; |
+ } |
result.resolve(options); |
}) |
return result.promise(); |
}; |
+var KEY_NAME = 'remoting-host-options'; |
}()); |