[Android] Browser: prevent access to uninitialized variable

Geoffrey Métais git at videolan.org
Fri Aug 2 14:57:50 CEST 2019


vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Aug  2 14:36:35 2019 +0200| [63a54e81d432106497a9175c883d97ae6c33085f] | committer: Geoffrey Métais

Browser: prevent access to uninitialized variable

(cherry picked from commit 109c99e95c01584656826a969131f410e7e27154)

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

 vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt b/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
index d384030a2..2bdb0912c 100644
--- a/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
+++ b/vlc-android/src/org/videolan/vlc/providers/BrowserProvider.kt
@@ -178,7 +178,7 @@ abstract class BrowserProvider(val context: Context, val dataset: LiveDataset<Me
                 var currentParsedPosition = -1
                 loop@ while (++currentParsedPosition < currentMediaList.size) {
                     if (!isActive) {
-                        browserChannel.close()
+                        if (::browserChannel.isInitialized) browserChannel.close()
                         break at loop
                     }
                     //skip media that are not browsable



More information about the Android mailing list