From c08510baa8c4458880614698524436b3c4428dea Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Sun, 15 Apr 2012 02:24:41 +0200 Subject: [PATCH] wxWindow::FindFocus() sometimes return NULL, check for that to avoid segfaulting --- Source/Core/DolphinWX/Src/TASInputDlg.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/Src/TASInputDlg.cpp b/Source/Core/DolphinWX/Src/TASInputDlg.cpp index 689681d199..65d17f6e03 100644 --- a/Source/Core/DolphinWX/Src/TASInputDlg.cpp +++ b/Source/Core/DolphinWX/Src/TASInputDlg.cpp @@ -371,5 +371,11 @@ void TASInputDlg::OnCloseWindow(wxCloseEvent& event) bool TASInputDlg::HasFocus() { - return (wxWindow::FindFocus() == this || wxWindow::FindFocus()->GetParent() == this); + if (wxWindow::FindFocus() == this) + return true; + else if (wxWindow::FindFocus() != NULL && + wxWindow::FindFocus()->GetParent() == this) + return true; + else + return false; }