Check that locale ID argument of wxUILocale ctor is not empty

Disallow using empty wxLocaleIdent here, GetDefault() can, and should,
be used for the user default locale.
This commit is contained in:
Vadim Zeitlin
2021-09-04 20:30:31 +02:00
parent be01b0c36a
commit a47a885718
2 changed files with 9 additions and 1 deletions

View File

@@ -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);
}