From 36e52897587c059def57160980e9e3b00730a41d Mon Sep 17 00:00:00 2001 From: Mike Marcus Date: Tue, 22 Oct 2024 09:33:51 -0400 Subject: [PATCH] GRUE-1114 modified how we read _exp items to work around Prebid's changes. --- modules/lotamePanoramaIdSystem.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/lotamePanoramaIdSystem.js b/modules/lotamePanoramaIdSystem.js index 813e34ca562..e2f001177a3 100644 --- a/modules/lotamePanoramaIdSystem.js +++ b/modules/lotamePanoramaIdSystem.js @@ -101,7 +101,13 @@ function getFromStorage(key) { if (storedValueExp === '' || storedValueExp === null) { value = storage.getDataFromLocalStorage(key, undefined); } else if (storedValueExp) { - if ((new Date(parseInt(storedValueExp, 10))).getTime() - Date.now() > 0) { + let expDate = undefined; + if (/^\d+$/.test(storedValueExp)) { + expDate = new Date(parseInt(storedValueExp, 10)); + } else { + expDate = new Date(storedValueExp); + } + if (expDate && !isNaN(expDate) && expDate.getTime() - Date.now() > 0) { value = storage.getDataFromLocalStorage(key, undefined); } }