[Android] Avoid NullPointerException in HistoryFragment

Jean-Baptiste Kempf git at videolan.org
Sun Sep 30 19:49:35 CEST 2012


vlc-ports/android | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sun Sep 30 19:49:13 2012 +0200| [68a2bbdea4368fe4934e113d60b5d8f1c437b1ab] | committer: Jean-Baptiste Kempf

Avoid NullPointerException in HistoryFragment

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
index b47dda6..9e0ee69 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryFragment.java
@@ -69,6 +69,7 @@ public class HistoryFragment extends SherlockListFragment {
 
     public void refresh() {
         Log.d(TAG, "Refreshing view!");
-        mHistoryAdapter.refresh();
+        if( mHistoryAdapter != null )
+            mHistoryAdapter.refresh();
     }
 }



More information about the Android mailing list