Skip to content

Commit 03ab98f

Browse files
OPTI-1528: check whether the label is null or blank
1 parent c1e1984 commit 03ab98f

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

ui/src/main/java/com/theoplayer/android/ui/Helper.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fun rememberTrackLabel(
9393
}
9494
},
9595
)
96-
if (!label.isNullOrEmpty()) {
96+
if (!label.isNullOrBlank()) {
9797
return@remember label
9898
}
9999
val localisedLanguage = track.localisedLanguage

ui/src/main/java/com/theoplayer/android/ui/util/CeaUtil.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package com.theoplayer.android.ui.util
22

3+
import androidx.annotation.CheckResult
34
import androidx.annotation.IntRange
45

56
private val CEA_FORMATTING_REGEX = "^CC(\\d+)$".toRegex()
67

78
/**
89
* Checks whether a provided label is CEA-608 or CEA-708 formed.
910
*/
11+
@CheckResult
1012
internal fun isLabelCeaFormatted(label: String?): Boolean {
1113
if (label == null) {
1214
return false
@@ -32,6 +34,7 @@ internal fun isLabelCeaFormatted(label: String?): Boolean {
3234
* @return an optional string composed of a [channelNumber] and a prepended
3335
* "CC" suffix, or `null` if the channel number is invalid.
3436
*/
37+
@CheckResult
3538
internal fun getLabelForChannelNumber(
3639
@IntRange(from = 0L, to = 63L) channelNumber: Int?,
3740
): String? {

0 commit comments

Comments
 (0)