X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..66f75561893ea7b4bf429d1882d9cc0407ba932d:/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;