[Android] MainActivity: fix potential NullDereference

Jean-Baptiste Kempf git at videolan.org
Thu Jul 17 08:19:35 CEST 2014


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Jul 17 07:33:23 2014 +0200| [45db7bb33f0fbde38c19c80513a01ae92b5baf06] | committer: Jean-Baptiste Kempf

MainActivity: fix potential NullDereference

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

 vlc-android/src/org/videolan/vlc/gui/MainActivity.java |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
index db568a2..362f2f7 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -229,7 +229,7 @@ public class MainActivity extends ActionBarActivity {
                 SidebarAdapter.SidebarEntry entry = (SidebarEntry) listView.getItemAtPosition(position);
                 Fragment current = getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder);
 
-                if(current == null || current.getTag().equals(entry.id)) { /* Already selected */
+                if(current == null || (entry != null && current.getTag().equals(entry.id))) { /* Already selected */
                     mMenu.showContent();
                     return;
                 }



More information about the Android mailing list