From fcd993c6273cec7900b951dd34e1ae1b8474babf Mon Sep 17 00:00:00 2001 From: mueller-ma Date: Tue, 16 Jul 2024 12:50:41 +0200 Subject: [PATCH] Ensure app bar title isn't empty (#3737) Signed-off-by: mueller-ma --- mobile/src/main/java/org/openhab/habdroid/ui/MainActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/MainActivity.kt b/mobile/src/main/java/org/openhab/habdroid/ui/MainActivity.kt index d37d5d7ed6..8e638e9c66 100644 --- a/mobile/src/main/java/org/openhab/habdroid/ui/MainActivity.kt +++ b/mobile/src/main/java/org/openhab/habdroid/ui/MainActivity.kt @@ -1331,7 +1331,7 @@ class MainActivity : AbstractBaseActivity(), ConnectionFactory.UpdateListener { fun updateTitle() { val title = controller.currentTitle val activeServerName = ServerConfiguration.load(prefs, getSecretPrefs(), prefs.getActiveServerId())?.name - setTitle(title ?: activeServerName ?: getString(R.string.app_name)) + setTitle(title.orDefaultIfEmpty(activeServerName.orEmpty()).orDefaultIfEmpty(getString(R.string.app_name))) drawerToggle.isDrawerIndicatorEnabled = !controller.canGoBack() }