From 8bbcf0af09118aa08ea9619af962557ac847090b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 23 Aug 2021 17:19:10 +0100 Subject: [PATCH] Check that wxFindReplaceDialog parent is non-null before using it Although this dialog is normally supposed to have a valid parent, don't crash if it doesn't have one when any of its buttons are pressed. --- src/common/fddlgcmn.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/fddlgcmn.cpp b/src/common/fddlgcmn.cpp index ee9bc86a37..8aeeec11ca 100644 --- a/src/common/fddlgcmn.cpp +++ b/src/common/fddlgcmn.cpp @@ -90,7 +90,8 @@ void wxFindReplaceDialogBase::Send(wxFindDialogEvent& event) // because the dialog is a top level window, so do it manually as // in 9 cases out of 10 the message must be processed by the dialog // owner and not the dialog itself - (void)GetParent()->ProcessWindowEvent(event); + if ( GetParent() ) + (void)GetParent()->ProcessWindowEvent(event); } }