From eb255a7ae83a116ca42e27a968f0443952ebe845 Mon Sep 17 00:00:00 2001 From: Jarne Demeulemeester Date: Sun, 27 Oct 2024 16:17:31 +0100 Subject: [PATCH] Check if Android device name is not blank (#1013) * fix(android): check if device name is not blank * refactor: use `!isNullOrBlank()` --- .../kotlin/org/jellyfin/sdk/android/AndroidDevice.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jellyfin-core/src/androidMain/kotlin/org/jellyfin/sdk/android/AndroidDevice.kt b/jellyfin-core/src/androidMain/kotlin/org/jellyfin/sdk/android/AndroidDevice.kt index 907fe3c05..1c31ff572 100644 --- a/jellyfin-core/src/androidMain/kotlin/org/jellyfin/sdk/android/AndroidDevice.kt +++ b/jellyfin-core/src/androidMain/kotlin/org/jellyfin/sdk/android/AndroidDevice.kt @@ -10,7 +10,7 @@ private fun Context.getDeviceName(): String { // Use name from device settings if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { val name = Settings.Global.getString(contentResolver, Settings.Global.DEVICE_NAME) - if (name != null) return name + if (!name.isNullOrBlank()) return name } // Concatenate the name based on manufacturer and model