From 87763976d8e84baf83ca02f9de49e7e3fcb708a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Resul=20=C3=96v=C3=BCr?= <92828257+ovurrsl@users.noreply.github.com> Date: Wed, 21 Oct 2026 01:31:27 +0300 Subject: [PATCH] fix: empty App ID no longer crashes the game environment editor (#1014) --- .../com/droiddeck/launcher/ui/GameEnvironmentEditor.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/GameEnvironmentEditor.kt b/app/src/main/java/com/droiddeck/launcher/ui/GameEnvironmentEditor.kt index 7557eb2495..f8f50a5ebc 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/GameEnvironmentEditor.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/GameEnvironmentEditor.kt @@ -143,15 +143,15 @@ internal fun GameEnvironmentEditor(byPad: Boolean, initialScope: String = "", on } } otherId?.let { id -> + val valid = id.isNotEmpty() && GameEnvironment.validScope(id) + val open = { if (valid) { scope = id.toLong().toString(); otherId = null } } Row(verticalAlignment = Alignment.Bottom, horizontalArrangement = Arrangement.spacedBy(10.dp)) { AdbTextField( id, { otherId = it.filter(Char::isDigit) }, stringResource(R.string.game_env_app_id), KeyboardType.Number, ImeAction.Done, modifier = Modifier.weight(1f), compact = true, - onDone = { if (GameEnvironment.validScope(id)) { scope = id.toLong().toString(); otherId = null } }, + onDone = open, ) - SecondaryButton(stringResource(R.string.game_env_open), enabled = id.isNotEmpty() && GameEnvironment.validScope(id)) { - scope = id.toLong().toString(); otherId = null - } + SecondaryButton(stringResource(R.string.game_env_open), enabled = valid, onClick = open) } } if (error) Small(stringResource(R.string.game_env_error), error = true)