]> git.saurik.com Git - wxWidgets.git/commitdiff
Added a check to make sure 'parent' is valid, otherwise a crash could occur
authorGeorge Tasker <gtasker@allenbrook.com>
Sat, 27 Jan 2001 12:55:44 +0000 (12:55 +0000)
committerGeorge Tasker <gtasker@allenbrook.com>
Sat, 27 Jan 2001 12:55:44 +0000 (12:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index 84dc12f4b7e930873ccae3a98fbfb10d2022f7dd..740a47fe7abaa301e6090021aeb59fb3ed903099 100644 (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 )