Skip to content

fix: handle null item.data in openHomeScreenShortcut - #693

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/deep-link-shortcut-null-data
Open

fix: handle null item.data in openHomeScreenShortcut#693
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/deep-link-shortcut-null-data

Conversation

@sentry

@sentry sentry Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This PR addresses a TypeError: Cannot read property 'originId' of null that occurred in the openHomeScreenShortcut function within src/hooks/use-deep-linking.ts.

The error was triggered when opening home screen shortcuts (e.g., static shortcuts) where the item.data property was null. The existing guard if (!item) return only checked for a null item itself, not for a null item.data.

To fix this, the following changes were made:

  1. The guard on line 62 was extended to if (!item || !item.data) return, ensuring that the function exits early if item or item.data is null.
  2. Optional chaining (item.data?.originId and item.data?.destinationId) was added on lines 63-64 for additional robustness when accessing properties of item.data.

Fixes BETTER-RAIL-3V

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.

0 participants