[Android] TvChannels: build fix

Geoffrey Métais git at videolan.org
Tue Feb 18 11:46:11 CET 2020


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb 18 11:45:56 2020 +0100| [fa4924887a2b5927edf53a87fd84a9a4cbc19a0d] | committer: Geoffrey Métais

TvChannels: build fix

> https://code.videolan.org/videolan/vlc-android/commit/fa4924887a2b5927edf53a87fd84a9a4cbc19a0d
---

 .../tools/src/main/java/videolan/org/commontools/TvChannelUtils.kt      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/application/tools/src/main/java/videolan/org/commontools/TvChannelUtils.kt b/application/tools/src/main/java/videolan/org/commontools/TvChannelUtils.kt
index a51b0e0b7..ec519e904 100644
--- a/application/tools/src/main/java/videolan/org/commontools/TvChannelUtils.kt
+++ b/application/tools/src/main/java/videolan/org/commontools/TvChannelUtils.kt
@@ -57,7 +57,7 @@ fun createOrUpdateChannel(prefs: SharedPreferences, context: Context, name: Stri
             .setDisplayName(name)
             .setAppLinkIntentUri(createUri(appId))
     if (channelId == -1L) {
-        val channelUri = context.contentResolver.insert(TvContractCompat.Channels.CONTENT_URI, builder.build().toContentValues())
+        val channelUri = context.contentResolver.insert(TvContractCompat.Channels.CONTENT_URI, builder.build().toContentValues()) ?: return -1L
         channelId = ContentUris.parseId(channelUri)
         prefs.edit().putLong(KEY_TV_CHANNEL_ID, channelId).apply()
         TvContractCompat.requestChannelBrowsable(context, channelId)



More information about the Android mailing list