@servicemind.tis/tis-smart-table-viewer 2.4.14 → 2.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -163,7 +163,17 @@ const getFromLocalStorageWithExpiry = (key) => {
|
|
|
163
163
|
if (!itemStr) {
|
|
164
164
|
return null;
|
|
165
165
|
}
|
|
166
|
-
|
|
166
|
+
// Guard against corrupt / non-JSON values (e.g. written by an older version
|
|
167
|
+
// or other code). Treat an unparseable entry as missing and self-heal by
|
|
168
|
+
// removing it, instead of throwing and breaking the caller (ngOnChanges).
|
|
169
|
+
let item;
|
|
170
|
+
try {
|
|
171
|
+
item = JSON.parse(itemStr);
|
|
172
|
+
}
|
|
173
|
+
catch {
|
|
174
|
+
localStorage.removeItem(key);
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
167
177
|
const now = new Date();
|
|
168
178
|
if (!item.expiry) {
|
|
169
179
|
localStorage.removeItem(key);
|