diff --git a/interface/wx/uilocale.h b/interface/wx/uilocale.h index 4c6bf8be9b..988acfd756 100644 --- a/interface/wx/uilocale.h +++ b/interface/wx/uilocale.h @@ -109,7 +109,8 @@ public: see wxLocaleIdent description for more details. If @a localeId is not recognized or not supported, default ("C") locale - is used instead. + is used instead. Additionally, if @a localeId is empty (see + wxLocaleIdent::IsEmpty()), an assertion failure is triggered. */ explicit wxUILocale(const wxLocaleIdent& localeId); diff --git a/src/common/uilocale.cpp b/src/common/uilocale.cpp index 1ce2d9f780..4ec4804497 100644 --- a/src/common/uilocale.cpp +++ b/src/common/uilocale.cpp @@ -158,6 +158,13 @@ const wxUILocale& wxUILocale::GetCurrent() wxUILocale::wxUILocale(const wxLocaleIdent& localeId) { + if ( localeId.IsEmpty() ) + { + wxFAIL_MSG( "Locale identifier must be initialized" ); + m_impl = NULL; + return; + } + m_impl = wxUILocaleImpl::CreateForLocale(localeId); }