From bc1500ed98d244886e96fa7c874c9e1ac6de0ddb Mon Sep 17 00:00:00 2001 From: ka3de Date: Fri, 17 Nov 2023 17:00:36 +0100 Subject: [PATCH] Fix NPE on NavigateFrame The newDocument field for a navigation event can be nil if the navigation happens within the same document. --- common/frame_manager.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/frame_manager.go b/common/frame_manager.go index cc3d191b4..666381d34 100644 --- a/common/frame_manager.go +++ b/common/frame_manager.go @@ -584,7 +584,9 @@ func (m *FrameManager) NavigateFrame(frame *Frame, url string, parsedOpts *Frame func(data any) bool { newDocID := <-newDocIDCh if evt, ok := data.(*NavigationEvent); ok { - return evt.newDocument.documentID == newDocID + if evt.newDocument != nil { + return evt.newDocument.documentID == newDocID + } } return false })