[Android] Prevent IllegalArgumentException

Geoffrey Métais git at videolan.org
Wed Jun 8 09:54:27 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jun  8 09:46:32 2016 +0200| [e2ef58780092dbe9647a839c9da49957dd90b9e0] | committer: Geoffrey Métais

Prevent IllegalArgumentException

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

 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 96c5f0e..1ef1f91 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaDatabase.java
+++ b/vlc-android/src/org/videolan/vlc/media/MediaDatabase.java
@@ -1309,6 +1309,8 @@ public class MediaDatabase {
     }
 
     public synchronized ArrayList<String> getSubtitles(String mediaName) {
+        if (TextUtils.isEmpty(mediaName))
+            return new ArrayList<>();
         Cursor cursor = mDb.query(EXTERNAL_SUBTITLES_TABLE_NAME,
                 new String[] {EXTERNAL_SUBTITLES_MEDIA_NAME, EXTERNAL_SUBTITLES_URI },
                 EXTERNAL_SUBTITLES_MEDIA_NAME + "=?",



More information about the Android mailing list