Commit 7a66fbdd authored by Geoffrey Métais's avatar Geoffrey Métais

Prevent NPE on TV browsers

parent cc5bbad8
......@@ -24,6 +24,7 @@
import android.annotation.TargetApi;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
......@@ -181,11 +182,14 @@ public abstract class SortedBrowserFragment extends BrowseFragment implements Br
public void updateList() {
Activity activity = getActivity();
if (activity == null)
ArrayObjectAdapter adapter;
HeaderItem header;
for (ListItem item : mMediaItemMap.values()){
adapter = new ArrayObjectAdapter(new CardPresenter(getActivity()));
adapter = new ArrayObjectAdapter(new CardPresenter(activity));
header = new HeaderItem(0, item.Letter);
adapter.addAll(0, item.mediaList);
mAdapter.add(new ListRow(header, adapter));
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