mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 10:55:46 -05:00
[locale] avoid crash when there are no good locales
If the running locale doesn't match any locale in the list, nothing is selected. Avoid a crash when referring to first() of an empty list.
This commit is contained in:
parent
9925d6666f
commit
c4e0456acc
1 changed files with 2 additions and 1 deletions
|
@ -84,5 +84,6 @@ LCLocaleDialog::LCLocaleDialog( const QString& guessedLCLocale, const QStringLis
|
||||||
QString
|
QString
|
||||||
LCLocaleDialog::selectedLCLocale()
|
LCLocaleDialog::selectedLCLocale()
|
||||||
{
|
{
|
||||||
return m_localesWidget->selectedItems().first()->text();
|
const auto items = m_localesWidget->selectedItems();
|
||||||
|
return items.isEmpty() ? QString{} : items.first()->text();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue