guard against NULL parents

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58003 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-01-11 00:40:09 +00:00
parent 9e48b1f56c
commit 6de4336e38

View File

@@ -1,6 +1,6 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: src/gtk/dcclient.cpp // Name: src/gtk/dcclient.cpp
// Purpose: // Purpose: wxWindowDCImpl implementation
// Author: Robert Roebling // Author: Robert Roebling
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) 1998 Robert Roebling, Chris Breeze // Copyright: (c) 1998 Robert Roebling, Chris Breeze
@@ -276,7 +276,8 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) :
if ( !widget ) if ( !widget )
{ {
window = window->GetParent(); window = window->GetParent();
widget = window->m_wxwindow; if (window)
widget = window->m_wxwindow;
} }
wxASSERT_MSG( widget, wxT("DC needs a widget") ); wxASSERT_MSG( widget, wxT("DC needs a widget") );