[Android] Prevent NPE

Geoffrey Métais git at videolan.org
Tue Feb 9 14:44:29 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb  9 12:01:22 2016 +0100| [cf4089bedf84fcf421ccbcb1e79f184f3d9c5a13] | committer: Geoffrey Métais

Prevent NPE

> https://code.videolan.org/videolan/vlc-android/commit/cf4089bedf84fcf421ccbcb1e79f184f3d9c5a13
---

 .../src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java
index 0008c2d..f600b07 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/browser/SortedBrowserFragment.java
@@ -310,8 +310,10 @@ public abstract class SortedBrowserFragment extends BrowseFragment implements Br
                     owner.updateList();
                     break;
                 case HIDE_LOADING:
-                    ((VerticalGridActivity)owner.getActivity()).showProgress(false);
-                    ((VerticalGridActivity)owner.getActivity()).updateEmptyView(owner.isEmpty());
+                    if (owner.getActivity() != null) {
+                        ((VerticalGridActivity)owner.getActivity()).showProgress(false);
+                        ((VerticalGridActivity)owner.getActivity()).updateEmptyView(owner.isEmpty());
+                    }
                     break;
             }
         }



More information about the Android mailing list