[Android] Check emptiness before saving subtitle

Geoffrey Métais git at videolan.org
Mon May 30 17:02:48 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon May 30 16:14:46 2016 +0200| [85def654c98670cf1e9fce72ef19404d82ad97c7] | committer: Geoffrey Métais

Check emptiness before saving subtitle

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

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

diff --git a/vlc-android/src/org/videolan/vlc/media/MediaDatabase.java b/vlc-android/src/org/videolan/vlc/media/MediaDatabase.java
index 7fcb73e..2b75e21 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaDatabase.java
+++ b/vlc-android/src/org/videolan/vlc/media/MediaDatabase.java
@@ -1300,6 +1300,8 @@ public class MediaDatabase {
      */
 
     public synchronized void saveSubtitle(String path, String mediaName) {
+        if (TextUtils.isEmpty(path) || TextUtils.isEmpty(mediaName))
+            return;
         ContentValues values = new ContentValues();
         values.put(EXTERNAL_SUBTITLES_URI, path);
         values.put(EXTERNAL_SUBTITLES_MEDIA_NAME, mediaName);



More information about the Android mailing list