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

Commit

Permalink
Merge pull request #7415 from SAPlayer/patch-1
Browse files Browse the repository at this point in the history
Fix convertPreferences to accept non-module clientIDs
  • Loading branch information
bchintx committed Apr 7, 2014
2 parents 8f3fc7b + e6b4ee4 commit 9b96168
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 9b96168

Please sign in to comment.