[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Wed Jun 22 12:19:24 CEST 2016


vlc-android | branch: 2.0.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jun 22 10:56:18 2016 +0200| [8d8c09a7de65933bf435830a35d5c808c0ecaaad] | committer: Geoffrey Métais

Prevent NPE

(cherry picked from commit 113c999944f8bbe9b19a8e646bc2017a70c14e7d)

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

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

diff --git a/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java b/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
index a633ad8..f2ceef0 100644
--- a/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
+++ b/vlc-android/src/org/videolan/vlc/util/SubtitlesDownloader.java
@@ -35,6 +35,7 @@ import android.os.Message;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.app.AppCompatActivity;
 import android.support.v7.preference.PreferenceManager;
+import android.text.TextUtils;
 import android.util.Log;
 import android.view.View;
 import android.view.WindowManager;
@@ -379,7 +380,7 @@ public class SubtitlesDownloader {
                     index.put(hash, mediaUri.getPath());
                     video.put("moviehash", hash);
                     video.put("moviebytesize", String.valueOf(fileLength));
-                } else {
+                } else if (!TextUtils.isEmpty(tag)) {
                     video.put("tag", tag);
                     int dotPos = tag.lastIndexOf('.');
                     if (dotPos > -1)



More information about the Android mailing list