X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..5d7792236f7e4fcbb94cdc2a5213e0c5788e8c28:/src/os2/spinctrl.cpp 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;