[Android] Prevent NPE for SortableFragment children classes
Geoffrey Métais
git at videolan.org
Wed Nov 8 10:13:51 CET 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Nov 8 10:12:54 2017 +0100| [1783ea1279f2f4f965351af75a386c4b416bcf73] | committer: Geoffrey Métais
Prevent NPE for SortableFragment children classes
> https://code.videolan.org/videolan/vlc-android/commit/1783ea1279f2f4f965351af75a386c4b416bcf73
---
vlc-android/src/org/videolan/vlc/gui/browser/SortableFragment.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/SortableFragment.java b/vlc-android/src/org/videolan/vlc/gui/browser/SortableFragment.java
index 3b5246885..2688df43f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/SortableFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/SortableFragment.java
@@ -51,7 +51,9 @@ public abstract class SortableFragment<T extends SortableAdapter> extends MediaB
@Override
public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden);
- getCurrentAdapter().updateIfSortChanged();
+ final T adapter = getCurrentAdapter();
+ if (adapter != null)
+ adapter.updateIfSortChanged();
}
@Override
More information about the Android
mailing list