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

Unified Diff: remoting/webapp/crd/js/options_export.js

Issue 2689593005: Send a correctly-formatted response if there are no host options saved. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c107e8b17515256c60269758d17933e23b868f71 100644
--- a/remoting/webapp/crd/js/options_export.js
+++ b/remoting/webapp/crd/js/options_export.js
@@ -21,6 +21,11 @@ remoting.OptionsExporter = function() {
remoting.OptionsExporter.migrateSettings_ = function() {
var result = new base.Deferred();
chrome.storage.local.get('remoting-host-options', function(options) {
kelvinp 2017/02/13 19:58:19 put 'remoting-host-options' as a variable?
Jamie 2017/02/14 02:48:16 Done.
+ // 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 = {'remoting-host-options': '{}'};
+ }
result.resolve(options);
})
return result.promise();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698