mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-12-23 05:16:58 +00:00
Some null checks. Fixes https://github.com/austinhuang0131/barinsta/issues/274
This commit is contained in:
parent
fececb5fd2
commit
b3d41ccffa
@ -200,7 +200,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
||||
Utils.openEmailAddress(getContext(), emailId);
|
||||
}
|
||||
|
||||
private void openPostDialog(final FeedModel feedModel,
|
||||
private void openPostDialog(@NonNull final FeedModel feedModel,
|
||||
final View profilePicView,
|
||||
final View mainPostImage,
|
||||
final int position) {
|
||||
@ -209,6 +209,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
||||
opening = true;
|
||||
new PostFetcher(feedModel.getShortCode(), newFeedModel -> {
|
||||
opening = false;
|
||||
if (newFeedModel == null) return;
|
||||
openPostDialog(newFeedModel, profilePicView, mainPostImage, position);
|
||||
}).execute();
|
||||
return;
|
||||
|
@ -198,7 +198,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
|
||||
Utils.openEmailAddress(getContext(), emailId);
|
||||
}
|
||||
|
||||
private void openPostDialog(final FeedModel feedModel,
|
||||
private void openPostDialog(@NonNull final FeedModel feedModel,
|
||||
final View profilePicView,
|
||||
final View mainPostImage,
|
||||
final int position) {
|
||||
@ -207,6 +207,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
|
||||
opening = true;
|
||||
new PostFetcher(feedModel.getShortCode(), newFeedModel -> {
|
||||
opening = false;
|
||||
if (newFeedModel == null) return;
|
||||
openPostDialog(newFeedModel, profilePicView, mainPostImage, position);
|
||||
}).execute();
|
||||
return;
|
||||
|
@ -91,6 +91,7 @@ public class DiscoverFragment extends Fragment implements SwipeRefreshLayout.OnR
|
||||
discoverService.topicalExplore(new DiscoverService.TopicalExploreRequest(), new ServiceCallback<DiscoverService.TopicalExploreResponse>() {
|
||||
@Override
|
||||
public void onSuccess(final DiscoverService.TopicalExploreResponse result) {
|
||||
if (result == null) return;
|
||||
topicClusterViewModel.getList().postValue(result.getClusters());
|
||||
binding.swipeRefreshLayout.setRefreshing(false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user