X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/170acdc90e9f92f8b8120fa6c04acdbf45c89582..28f9f58ca0cff0a771f794fa4c1a1f59af72eb2a:/src/msw/radiobox.cpp diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 95f6f127c4..45424eb27e 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -323,7 +323,7 @@ void wxRadioBox::SendNotificationEvent() unsigned int wxRadioBox::GetCount() const { - return m_radioButtons->GetCount(); + return m_radioButtons ? m_radioButtons->GetCount() : 0u; } void wxRadioBox::SetString(unsigned int item, const wxString& label) @@ -505,6 +505,13 @@ wxSize wxRadioBox::GetTotalButtonSize(const wxSize& sizeBtn) const wxSize wxRadioBox::DoGetBestSize() const { + if ( !m_radioButtons ) + { + // if we're not fully initialized yet, we can't meaningfully compute + // our best size, we'll do it later + return wxSize(1, 1); + } + wxSize best = GetTotalButtonSize(GetMaxButtonSize()); CacheBestSize(best); return best;