mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-21 22:27:29 +00:00
Null check. Fixes https://github.com/austinhuang0131/barinsta/issues/991
This commit is contained in:
parent
f570ea6146
commit
1c1e5f0654
@ -24,6 +24,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import awais.instagrabber.R;
|
||||
@ -98,8 +99,7 @@ public final class StoryListViewerFragment extends Fragment implements SwipeRefr
|
||||
final Context context = getContext();
|
||||
Toast.makeText(context, R.string.empty_list, Toast.LENGTH_SHORT).show();
|
||||
} catch (Exception ignored) {}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
endCursor = result.getNextCursor();
|
||||
final List<HighlightModel> models = archivesViewModel.getList().getValue();
|
||||
final List<HighlightModel> modelsCopy = models == null ? new ArrayList<>() : new ArrayList<>(models);
|
||||
@ -198,7 +198,13 @@ public final class StoryListViewerFragment extends Fragment implements SwipeRefr
|
||||
adapter = new FeedStoriesListAdapter(clickListener);
|
||||
binding.rvStories.setLayoutManager(layoutManager);
|
||||
binding.rvStories.setAdapter(adapter);
|
||||
feedStoriesViewModel.getList().observe(getViewLifecycleOwner(), adapter::submitList);
|
||||
feedStoriesViewModel.getList().observe(getViewLifecycleOwner(), list -> {
|
||||
if (list == null) {
|
||||
adapter.submitList(Collections.emptyList());
|
||||
return;
|
||||
}
|
||||
adapter.submitList(list);
|
||||
});
|
||||
} else {
|
||||
if (actionBar != null) actionBar.setTitle(R.string.action_archive);
|
||||
final RecyclerLazyLoader lazyLoader = new RecyclerLazyLoader(layoutManager, (page, totalItemsCount) -> {
|
||||
|
Loading…
Reference in New Issue
Block a user