[locale] Avoid nullptr if there is no location

main
Adriaan de Groot 5 years ago
parent 0c9480aa3f
commit 781d76c9e5

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

Loading…
Cancel
Save