[Android] DB manager: fix unlikely crash

Jean-Baptiste Kempf git at videolan.org
Mon Oct 8 15:41:13 CEST 2012


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Oct  8 15:41:05 2012 +0200| [84ed2b72b4e82380f3fcf0ed11b07ce3f7703ecf] | committer: Jean-Baptiste Kempf

DB manager: fix unlikely crash

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=84ed2b72b4e82380f3fcf0ed11b07ce3f7703ecf
---

 vlc-android/src/org/videolan/vlc/DatabaseManager.java |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/DatabaseManager.java b/vlc-android/src/org/videolan/vlc/DatabaseManager.java
index e831aca..7003a8e 100644
--- a/vlc-android/src/org/videolan/vlc/DatabaseManager.java
+++ b/vlc-android/src/org/videolan/vlc/DatabaseManager.java
@@ -459,6 +459,10 @@ public class DatabaseManager {
 
     public synchronized void updateMedia(String location, mediaColumn col,
             Object object) {
+
+        if (location == null)
+            return;
+
         ContentValues values = new ContentValues();
         switch (col) {
             case MEDIA_PICTURE:
@@ -584,7 +588,7 @@ public class DatabaseManager {
     public synchronized void clearSearchhistory() {
         mDb.delete(SEARCHHISTORY_TABLE_NAME, null, null);
     }
-    
+
     /**
      * Empty the database for debugging purposes
      */



More information about the Android mailing list