Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Fix convertPreferences to accept non-module clientIDs #7415

Merged
merged 1 commit into from
Apr 7, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/preferences/PreferencesManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,17 @@ define(function (require, exports, module) {
function convertPreferences(clientID, rules, isViewState, prefCheckCallback) {
PreferencesImpl.smUserScopeLoading.done(function () {
PreferencesImpl.userScopeLoading.done(function () {
if (!clientID || (typeof clientID === "object" && (!clientID.id || !clientID.uri))) {
console.error("Invalid clientID");
return;
}
var prefs = getPreferenceStorage(clientID, null, true);

if (!prefs) {
return;
}

var prefsID = getClientID(clientID);
var prefsID = typeof clientID === "object" ? getClientID(clientID) : clientID;
if (prefStorage.convertedKeysMap === undefined) {
prefStorage.convertedKeysMap = {};
}
Expand All @@ -354,7 +358,7 @@ define(function (require, exports, module) {
savePreferences();
});
}).fail(function (error) {
console.error("Error while converting ", getClientID(clientID));
console.error("Error while converting ", typeof clientID === "object" ? getClientID(clientID) : clientID);
console.error(error);
});
});
Expand Down