Commit 56564869 authored by Geoffrey Métais's avatar Geoffrey Métais

Check getActivity is not null

(cherry picked from commit 8493e217)
parent 4a0848de
...@@ -139,11 +139,12 @@ public class HistoryFragment extends MediaBrowserFragment implements IRefreshabl ...@@ -139,11 +139,12 @@ public class HistoryFragment extends MediaBrowserFragment implements IRefreshabl
public void handleMessage(Message msg) { public void handleMessage(Message msg) {
switch (msg.what){ switch (msg.what){
case UPDATE_LIST: case UPDATE_LIST:
if (getActivity() == null)
return;
mHistoryAdapter.setList((ArrayList<MediaWrapper>) msg.obj); mHistoryAdapter.setList((ArrayList<MediaWrapper>) msg.obj);
updateEmptyView(); updateEmptyView();
if( mHistoryAdapter != null ) { if (mHistoryAdapter != null)
mHistoryAdapter.notifyDataSetChanged(); mHistoryAdapter.notifyDataSetChanged();
}
mSwipeRefreshLayout.setRefreshing(false); mSwipeRefreshLayout.setRefreshing(false);
getActivity().supportInvalidateOptionsMenu(); getActivity().supportInvalidateOptionsMenu();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment