[Android] Prevent NPE in case of hash mismatch

Geoffrey Métais git at videolan.org
Mon Jun 27 14:18:41 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Jun 27 14:17:45 2016 +0200| [0e60b57007394588355a34ef438ecfcfe6862d7e] | committer: Geoffrey Métais

Prevent NPE in case of hash mismatch

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

 vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java b/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
index f2ceef0..4971901 100644
--- a/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
+++ b/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
@@ -195,6 +195,8 @@ public class SubtitlesDownloader {
                         subLanguageID = ((HashMap<String, String>) map).get("SubLanguageID");
                         subDownloadLink = ((HashMap<String, String>) map).get("SubDownloadLink");
                         fileUrl = index.get(movieHash);
+                        if (fileUrl == null)
+                            return;
 
                         fileName = fileUrl.substring(fileUrl.lastIndexOf('/') + 1);
                         if (success.containsKey(fileName) && success.get(fileName).contains(subLanguageID)){



More information about the Android mailing list