mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
adding fallback locale for when the configuration locale is missing
This commit is contained in:
parent
524dcbb3d1
commit
4ffce89ef2
1 changed files with 1 additions and 1 deletions
|
@ -26,7 +26,7 @@ import javax.inject.Inject
|
|||
class LocaleProvider @Inject constructor(private val resources: Resources) {
|
||||
|
||||
fun current(): Locale {
|
||||
return ConfigurationCompat.getLocales(resources.configuration)[0]
|
||||
return ConfigurationCompat.getLocales(resources.configuration).get(0) ?: Locale.getDefault()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue