Fixed null pointer exception

This commit is contained in:
Anthony Restaino 2016-03-28 19:59:42 -04:00
parent e9d01dc104
commit 6d47d7232f

View File

@ -98,9 +98,13 @@ public class BookmarksFragment extends Fragment implements View.OnClickListener,
return Observable.create(new Action<BookmarkViewAdapter>() {
@Override
public void onSubscribe(@NonNull Subscriber<BookmarkViewAdapter> subscriber) {
mBookmarkAdapter = new BookmarkViewAdapter(getContext(), mBookmarks);
setBookmarkDataSet(mBookmarkManager.getBookmarksFromFolder(null, true), false);
subscriber.onNext(mBookmarkAdapter);
Context context = getContext();
if (context != null) {
mBookmarkAdapter = new BookmarkViewAdapter(getContext(), mBookmarks);
setBookmarkDataSet(mBookmarkManager.getBookmarksFromFolder(null, true), false);
subscriber.onNext(mBookmarkAdapter);
}
subscriber.onComplete();
}
});
}