Chek if getContext() is instanceOf CategoryImagesCallback and only then request more images

This commit is contained in:
Kshitij Bhardwaj 2020-03-14 05:30:33 -04:00 committed by GitHub
parent a78e167676
commit 668b5896a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -329,7 +329,7 @@ public class MediaDetailPagerFragment extends CommonsDaggerSupportFragment imple
Timber.d("Returning as activity is destroyed!");
return;
}
if (i+1 >= adapter.getCount())
if (i+1 >= adapter.getCount() && getContext() instanceof CategoryImagesCallback)
((CategoryImagesCallback) getContext()).requestMoreImages();
getActivity().invalidateOptionsMenu();