Added a check to make sure 'parent' is valid, otherwise a crash could occur

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
George Tasker
2001-01-27 12:55:44 +00:00
parent 8e19f54e55
commit 89e3037cc9

View File

@@ -1150,11 +1150,14 @@ void wxWindow::DoGetPosition(int *x, int *y) const
::ScreenToClient(hParentWnd, &point);
}
// We may be faking the client origin. So a window that's really at (0,
// 30) may appear (to wxWin apps) to be at (0, 0).
wxPoint pt(parent->GetClientAreaOrigin());
point.x -= pt.x;
point.y -= pt.y;
if ( parent )
{
// We may be faking the client origin. So a window that's really at (0,
// 30) may appear (to wxWin apps) to be at (0, 0).
wxPoint pt(parent->GetClientAreaOrigin());
point.x -= pt.x;
point.y -= pt.y;
}
}
if ( x )