[Android] Fix possible NullPointerException

Jean-Baptiste Kempf git at videolan.org
Fri Sep 28 11:43:11 CEST 2012


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Sep 28 10:47:08 2012 +0200| [bb5dfe0f7ab82a23970cf37f64e88eadd1b6520c] | committer: Jean-Baptiste Kempf

Fix possible NullPointerException

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

 vlc-android/src/org/videolan/vlc/gui/MainActivity.java |    3 ++-
 1 file changed, 2 insertions(+), 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 d6ca5d9..bef5ddf 100644
--- a/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/MainActivity.java
@@ -195,7 +195,8 @@ public class MainActivity extends SherlockFragmentActivity {
                     int position, long id) {
                 SidebarAdapter.SidebarEntry entry = (SidebarEntry) listView.getItemAtPosition(position);
                 Fragment current = getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder);
-                if(current.getTag() == entry.id) /* Already selected */
+             
+                if(current == null || current.getTag() == entry.id) /* Already selected */
                     return;
 
                 /* Clear any backstack before switching tabs.



More information about the Android mailing list