From adfe31645d07ef9ae706f46994d9b4950bd8c370 Mon Sep 17 00:00:00 2001 From: Stefan Neis Date: Sun, 13 Sep 2009 15:48:40 +0000 Subject: [PATCH] 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 --- src/os2/spinbutt.cpp | 7 +++++-- src/os2/spinctrl.cpp | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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; -- 2.45.2