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

Commit 9b96168

Browse files
committed
Merge pull request #7415 from SAPlayer/patch-1
Fix convertPreferences to accept non-module clientIDs
2 parents 8f3fc7b + e6b4ee4 commit 9b96168

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/preferences/PreferencesManager.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,17 @@ define(function (require, exports, module) {
336336
function convertPreferences(clientID, rules, isViewState, prefCheckCallback) {
337337
PreferencesImpl.smUserScopeLoading.done(function () {
338338
PreferencesImpl.userScopeLoading.done(function () {
339+
if (!clientID || (typeof clientID === "object" && (!clientID.id || !clientID.uri))) {
340+
console.error("Invalid clientID");
341+
return;
342+
}
339343
var prefs = getPreferenceStorage(clientID, null, true);
340344

341345
if (!prefs) {
342346
return;
343347
}
344348

345-
var prefsID = getClientID(clientID);
349+
var prefsID = typeof clientID === "object" ? getClientID(clientID) : clientID;
346350
if (prefStorage.convertedKeysMap === undefined) {
347351
prefStorage.convertedKeysMap = {};
348352
}
@@ -354,7 +358,7 @@ define(function (require, exports, module) {
354358
savePreferences();
355359
});
356360
}).fail(function (error) {
357-
console.error("Error while converting ", getClientID(clientID));
361+
console.error("Error while converting ", typeof clientID === "object" ? getClientID(clientID) : clientID);
358362
console.error(error);
359363
});
360364
});

0 commit comments

Comments
 (0)