Skip to content

Conversation

@michelezonca
Copy link

Hi everyone,
I ran into the following runtime error when accessing a bookmark destination (from a namedDestination):

type 'PdfNull' is not a subtype of type 'PdfNumber?' in type cast

Unfortunately I cann't share the original PDF (probably malformed), but it opens correctly on other viewers.

This PR fixes the issue by adding a simple defensive type check before casting the destination value to PdfNumber, preventing invalid casts when the destination contains PdfNull (or anything else)

Add additional check to avoid 
> type 'PdfNull' is not a subtype of type 'PdfNumber?' in type cast
@immankumarsync immankumarsync added pdf PDF component open Open labels Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

open Open pdf PDF component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants