[locale] Avoid nullptr deref

- when no location has been set at all, there's no sensible TZ
  to report; just leave it blank. In *practice* you won't hit this
  code from the Calamares UI before a location has been set, because
  the Config object is instantiated and then immediately configured,
  but from tests or unusual UIs it could be.
main
Adriaan de Groot 5 years ago
parent b36ad4c7f4
commit eda14ce548

@ -318,7 +318,9 @@ Config::setLCLocaleExplicitly( const QString& locale )
QString QString
Config::currentLocationStatus() const Config::currentLocationStatus() const
{ {
return tr( "Set timezone to %1/%2." ).arg( m_currentLocation->region(), m_currentLocation->zone() ); return tr( "Set timezone to %1/%2." )
.arg( m_currentLocation ? m_currentLocation->region() : QString(),
m_currentLocation ? m_currentLocation->zone() : QString() );
} }
static inline QString static inline QString

Loading…
Cancel
Save