mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-12-23 13:26:59 +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);
|
Utils.openEmailAddress(getContext(), emailId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openPostDialog(final FeedModel feedModel,
|
private void openPostDialog(@NonNull final FeedModel feedModel,
|
||||||
final View profilePicView,
|
final View profilePicView,
|
||||||
final View mainPostImage,
|
final View mainPostImage,
|
||||||
final int position) {
|
final int position) {
|
||||||
@ -209,6 +209,7 @@ public class HashTagFragment extends Fragment implements SwipeRefreshLayout.OnRe
|
|||||||
opening = true;
|
opening = true;
|
||||||
new PostFetcher(feedModel.getShortCode(), newFeedModel -> {
|
new PostFetcher(feedModel.getShortCode(), newFeedModel -> {
|
||||||
opening = false;
|
opening = false;
|
||||||
|
if (newFeedModel == null) return;
|
||||||
openPostDialog(newFeedModel, profilePicView, mainPostImage, position);
|
openPostDialog(newFeedModel, profilePicView, mainPostImage, position);
|
||||||
}).execute();
|
}).execute();
|
||||||
return;
|
return;
|
||||||
|
@ -198,7 +198,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
|
|||||||
Utils.openEmailAddress(getContext(), emailId);
|
Utils.openEmailAddress(getContext(), emailId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void openPostDialog(final FeedModel feedModel,
|
private void openPostDialog(@NonNull final FeedModel feedModel,
|
||||||
final View profilePicView,
|
final View profilePicView,
|
||||||
final View mainPostImage,
|
final View mainPostImage,
|
||||||
final int position) {
|
final int position) {
|
||||||
@ -207,6 +207,7 @@ public class LocationFragment extends Fragment implements SwipeRefreshLayout.OnR
|
|||||||
opening = true;
|
opening = true;
|
||||||
new PostFetcher(feedModel.getShortCode(), newFeedModel -> {
|
new PostFetcher(feedModel.getShortCode(), newFeedModel -> {
|
||||||
opening = false;
|
opening = false;
|
||||||
|
if (newFeedModel == null) return;
|
||||||
openPostDialog(newFeedModel, profilePicView, mainPostImage, position);
|
openPostDialog(newFeedModel, profilePicView, mainPostImage, position);
|
||||||
}).execute();
|
}).execute();
|
||||||
return;
|
return;
|
||||||
|
@ -91,6 +91,7 @@ public class DiscoverFragment extends Fragment implements SwipeRefreshLayout.OnR
|
|||||||
discoverService.topicalExplore(new DiscoverService.TopicalExploreRequest(), new ServiceCallback<DiscoverService.TopicalExploreResponse>() {
|
discoverService.topicalExplore(new DiscoverService.TopicalExploreRequest(), new ServiceCallback<DiscoverService.TopicalExploreResponse>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(final DiscoverService.TopicalExploreResponse result) {
|
public void onSuccess(final DiscoverService.TopicalExploreResponse result) {
|
||||||
|
if (result == null) return;
|
||||||
topicClusterViewModel.getList().postValue(result.getClusters());
|
topicClusterViewModel.getList().postValue(result.getClusters());
|
||||||
binding.swipeRefreshLayout.setRefreshing(false);
|
binding.swipeRefreshLayout.setRefreshing(false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user