From 781d76c9e540a346f7cf6dd6cb9643a74bd0f51c Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Wed, 22 Jul 2020 00:32:29 +0200 Subject: [PATCH] [locale] Avoid nullptr if there is no location --- src/modules/locale/Config.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/locale/Config.cpp b/src/modules/locale/Config.cpp index cb0fe7734..0898a77f2 100644 --- a/src/modules/locale/Config.cpp +++ b/src/modules/locale/Config.cpp @@ -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() ); }