From: Stefan Neis Date: Sun, 13 Sep 2009 15:48:40 +0000 (+0000) Subject: Be more paranoid about parent window possibly being NULL (partly fixes #11115). X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/adfe31645d07ef9ae706f46994d9b4950bd8c370 Be more paranoid about parent window possibly being NULL (partly fixes #11115). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/os2/spinbutt.cpp b/src/os2/spinbutt.cpp index a7b3237f25..533b209728 100644 --- a/src/os2/spinbutt.cpp +++ b/src/os2/spinbutt.cpp @@ -63,8 +63,11 @@ bool wxSpinButton::Create( m_windowId = NewControlId(); else m_windowId = vId; - m_backgroundColour = pParent->GetBackgroundColour(); - m_foregroundColour = pParent->GetForegroundColour(); + if (pParent) + { + m_backgroundColour = pParent->GetBackgroundColour(); + m_foregroundColour = pParent->GetForegroundColour(); + } SetName(rsName); SetParent(pParent); m_windowStyle = lStyle; diff --git a/src/os2/spinctrl.cpp b/src/os2/spinctrl.cpp index 72d677a720..c9d8187d94 100644 --- a/src/os2/spinctrl.cpp +++ b/src/os2/spinctrl.cpp @@ -126,8 +126,11 @@ bool wxSpinCtrl::Create( wxWindow* pParent, m_windowId = NewControlId(); else m_windowId = vId; - m_backgroundColour = pParent->GetBackgroundColour(); - m_foregroundColour = pParent->GetForegroundColour(); + if (pParent) + { + m_backgroundColour = pParent->GetBackgroundColour(); + m_foregroundColour = pParent->GetForegroundColour(); + } SetName(rsName); SetParent(pParent); m_windowStyle = lStyle;