mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Uri.parse would throw NullPointerException if the image in MediaDetailFragment was clicked before the image URL is available
This commit is contained in:
parent
dc6a3e507b
commit
11ff5fb055
1 changed files with 6 additions and 4 deletions
|
|
@ -222,10 +222,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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue