[locale] Avoid nullptr if there is no location

This commit is contained in:
Adriaan de Groot 2020-07-22 00:32:29 +02:00
parent 0c9480aa3f
commit 781d76c9e5

View File

@ -255,6 +255,11 @@ Config::setCurrentLocation( const CalamaresUtils::Locale::TZZone* location )
LocaleConfiguration LocaleConfiguration
Config::automaticLocaleConfiguration() const Config::automaticLocaleConfiguration() const
{ {
// Special case: no location has been set at **all**
if ( !currentLocation() )
{
return LocaleConfiguration();
}
return LocaleConfiguration::fromLanguageAndLocation( return LocaleConfiguration::fromLanguageAndLocation(
QLocale().name(), supportedLocales(), currentLocation()->country() ); QLocale().name(), supportedLocales(), currentLocation()->country() );
} }