xcode 9 runtime checks showed nullptr access here in dialogs sample

This commit is contained in:
Stefan Csomor
2017-06-11 18:05:15 +02:00
parent 0873b809a2
commit df898c0e44

View File

@@ -155,7 +155,8 @@ void wxStatusBarMac::OnPaint(wxPaintEvent& WXUNUSED(event))
// that case, statusbar appearance shouldn't change. It also shouldn't
// change if a window-modal sheet attached to this window is key.
wxTopLevelWindow *tlw = wxDynamicCast(MacGetTopLevelWindow(), wxTopLevelWindow);
wxWindow *keyWindow = wxNonOwnedWindow::GetFromWXWindow(wxOSXGetKeyWindow())->MacGetTopLevelWindow();
wxNonOwnedWindow* directKeyWindow = wxNonOwnedWindow::GetFromWXWindow(wxOSXGetKeyWindow());
wxWindow *keyWindow = directKeyWindow ? directKeyWindow->MacGetTopLevelWindow() : NULL;
while ( keyWindow && keyWindow != tlw )
{
wxDialog *dlg = wxDynamicCast(keyWindow, wxDialog);