Skip to content

fix: null-guard storage targets and page tags to prevent crashes#8005

Open
derekderie wants to merge 1 commit into
requarks:mainfrom
AConsultancyCompany:fix/null-guard-storage-targets-and-tags
Open

fix: null-guard storage targets and page tags to prevent crashes#8005
derekderie wants to merge 1 commit into
requarks:mainfrom
AConsultancyCompany:fix/null-guard-storage-targets-and-tags

Conversation

@derekderie
Copy link
Copy Markdown

@derekderie derekderie commented May 12, 2026

Problem

Two places in the storage layer can throw a TypeError: Cannot read properties of undefined when iterating over collections that may not be initialized:

  • Storage.targets can be undefined when storage hasn't been
    activated/configured yet. Affects pageEvent, assetEvent, and
    getLocalLocations.
  • currentPage.tags can be undefined when a page was imported or
    created without tags. Affects the disk storage common.js handler.

Fix

Add || [] fallback guards so these methods degrade gracefully instead of throwing:

  • server/models/storage.js — 3 occurrences
  • server/modules/storage/disk/common.js — 1 occurrence

@auto-assign auto-assign Bot requested a review from NGPixel May 12, 2026 06:30
@derekderie
Copy link
Copy Markdown
Author

Found the root cause of #7978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants