Check for null return value in wxClientDC constructor

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15578 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2002-05-15 20:03:07 +00:00
parent f4bd67593e
commit 7882729eb5
2 changed files with 4 additions and 0 deletions

View File

@ -85,6 +85,8 @@ wxClientDC::wxClientDC()
wxClientDC::wxClientDC(wxWindow *window)
{
wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ;
if (!rootwindow)
return;
WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ;
wxPoint origin = window->GetClientAreaOrigin() ;
wxSize size = window->GetClientSize() ;

View File

@ -85,6 +85,8 @@ wxClientDC::wxClientDC()
wxClientDC::wxClientDC(wxWindow *window)
{
wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ;
if (!rootwindow)
return;
WindowRef windowref = (WindowRef) rootwindow->MacGetWindowRef() ;
wxPoint origin = window->GetClientAreaOrigin() ;
wxSize size = window->GetClientSize() ;