diff --git a/modules/userId/index.js b/modules/userId/index.js index 3253be42a76..be9883dae9c 100644 --- a/modules/userId/index.js +++ b/modules/userId/index.js @@ -247,7 +247,7 @@ function getStoredValue(storage, key = undefined) { } } // support storing a string or a stringified object - if (typeof storedValue === 'string' && storedValue.charAt(0) === '{') { + if (typeof storedValue === 'string' && storedValue.trim().charAt(0) === '{') { storedValue = JSON.parse(storedValue); } } catch (e) {