Skip to content

Commit

Permalink
Fix NPE on NavigateFrame
Browse files Browse the repository at this point in the history
The newDocument field for a navigation event can be nil if the
navigation happens within the same document.
  • Loading branch information
ka3de authored and ankur22 committed Nov 29, 2023
1 parent d785975 commit 86329fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/frame_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
Expand Down

0 comments on commit 86329fb

Please sign in to comment.