]> git.saurik.com Git - wxWidgets.git/commitdiff
Be more paranoid about parent window possibly being NULL (partly fixes #11115).
authorStefan Neis <Stefan.Neis@t-online.de>
Sun, 13 Sep 2009 15:48:40 +0000 (15:48 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Sun, 13 Sep 2009 15:48:40 +0000 (15:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/spinbutt.cpp
src/os2/spinctrl.cpp

index a7b3237f2519668198a25eca7634feff970d63e0..533b209728ae3466a5c77174d234491e21ad510e 100644 (file)
@@ -63,8 +63,11 @@ bool wxSpinButton::Create(
         m_windowId = NewControlId();
     else
         m_windowId = vId;
         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;
     SetName(rsName);
     SetParent(pParent);
     m_windowStyle      = lStyle;
index 72d677a720fb1af74c162dbca49fa5e6f213e6cb..c9d8187d9444bd7a0adee11f200061757b401769 100644 (file)
@@ -126,8 +126,11 @@ bool wxSpinCtrl::Create( wxWindow*       pParent,
         m_windowId = NewControlId();
     else
         m_windowId = vId;
         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;
     SetName(rsName);
     SetParent(pParent);
     m_windowStyle      = lStyle;