Fix crash when migrated layouts have more than 1 subtype and one of which has no layout specifier

This commit is contained in:
Aleksandras Kostarevas 2024-05-15 16:30:57 -05:00
parent eb65ad124d
commit a994bb5432
2 changed files with 2 additions and 1 deletions

View File

@ -612,4 +612,5 @@ Tip: You can download and remove dictionaries by going to <b>Languages &
<string name="layout_telugu">Telugu</string>
<string name="layout_thai">Thai</string>
<string name="layout_uzbek">Uzbek</string>
<string name="layout_default">Default</string>
</resources>

View File

@ -235,7 +235,7 @@ fun LanguagesScreen(navController: NavHostController = rememberNavController())
subtypes.forEach {
val layout = Subtypes.getLayoutName(
context,
it.getExtraValueOf(Constants.Subtype.ExtraValue.KEYBOARD_LAYOUT_SET)
it.getExtraValueOf(Constants.Subtype.ExtraValue.KEYBOARD_LAYOUT_SET) ?: "default"
)
SettingItem(title = "Layout $layout") {
IconButton(modifier = Modifier.fillMaxHeight(), onClick = {