diff --git a/src/mac/carbon/spinctrl.cpp b/src/mac/carbon/spinctrl.cpp index 3316f6a92e..b006866a06 100644 --- a/src/mac/carbon/spinctrl.cpp +++ b/src/mac/carbon/spinctrl.cpp @@ -196,6 +196,9 @@ wxSpinCtrl::~wxSpinCtrl() wxSize wxSpinCtrl::DoGetBestSize() const { + if (!m_btn || !m_text) + return GetSize(); + wxSize sizeBtn = m_btn->GetBestSize(), sizeText = m_text->GetBestSize();