Fix NullPointer when clicking on image in MediaDetailFragment (#3730)… (#3739)

This commit is contained in:
Ashish Kumar 2020-05-12 16:07:17 +05:30 committed by GitHub
parent 63018fcbd5
commit bff923135e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -209,10 +209,12 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
@OnClick(R.id.mediaDetailImageViewSpacer) @OnClick(R.id.mediaDetailImageViewSpacer)
public void launchZoomActivity(View view) { public void launchZoomActivity(View view) {
Context ctx = view.getContext(); if (media.getImageUrl() != null) {
ctx.startActivity( Context ctx = view.getContext();
new Intent(ctx,ZoomableActivity.class).setData(Uri.parse(media.getImageUrl())) ctx.startActivity(
); new Intent(ctx, ZoomableActivity.class).setData(Uri.parse(media.getImageUrl()))
);
}
} }
@Override @Override

View file

@ -1120,9 +1120,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
boolean filterForPlaceState, boolean filterForPlaceState,
boolean filterForAllNoneType) { boolean filterForAllNoneType) {
// Remove the previous markers before updating them
hideAllMarkers(); hideAllMarkers();
for (MarkerPlaceGroup markerPlaceGroup : NearbyController.markerLabelList) { for (MarkerPlaceGroup markerPlaceGroup : NearbyController.markerLabelList) {
Place place = markerPlaceGroup.getPlace(); Place place = markerPlaceGroup.getPlace();
@ -1217,7 +1215,7 @@ public class NearbyParentFragment extends CommonsDaggerSupportFragment
* since grey icon may lead the users to believe that it is disabled or prohibited contribution * since grey icon may lead the users to believe that it is disabled or prohibited contribution
*/ */
private void hideAllMArkers() { private void hideAllMarkers() {
VectorDrawableCompat vectorDrawable; VectorDrawableCompat vectorDrawable;
vectorDrawable = VectorDrawableCompat.create( vectorDrawable = VectorDrawableCompat.create(
getContext().getResources(), R.drawable.ic_custom_greyed_out_marker, getContext().getTheme()); getContext().getResources(), R.drawable.ic_custom_greyed_out_marker, getContext().getTheme());