mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-22 03:05:32 +02:00
fix(frontend): prevent 'reading some of undefined' crash from stale sessionStorage
Old captureItems entries saved before the playlist fields were added have playlistItems=undefined (missing key). The hasConflict guard checked !== null, which undefined passes, then called .some() on undefined → TypeError. Two-part fix: 1. sessionStorage restore: merge each saved item over makeItem() defaults so any missing fields (playlistItems, playlistProbeState, etc.) are filled with their correct initial values before the item is used 2. hasConflict: use Array.isArray() instead of !== null so undefined is also safely rejected — defence-in-depth for any future field gap
This commit is contained in:
parent
aed9c581fd
commit
cca4742f89
3 changed files with 13 additions and 11 deletions
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue