mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Do not crash in details view if we try to view local image
Makes sure that if we don't have an image set, we just do nothing rather than crash badly Change-Id: Id1947be4cda1dff1610c69213d7ada986c6a9c67 GitHub: https://github.com/wikimedia/apps-android-commons/pull/9
This commit is contained in:
parent
65a01c4459
commit
4de5c124e1
1 changed files with 4 additions and 2 deletions
|
|
@ -78,6 +78,10 @@ public class MediaWikiImageView extends ImageView {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(mMedia == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final String mUrl;
|
final String mUrl;
|
||||||
if(tryOriginal) {
|
if(tryOriginal) {
|
||||||
mUrl = mMedia.getImageUrl();
|
mUrl = mMedia.getImageUrl();
|
||||||
|
|
@ -172,9 +176,7 @@ public class MediaWikiImageView extends ImageView {
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||||
super.onLayout(changed, left, top, right, bottom);
|
super.onLayout(changed, left, top, right, bottom);
|
||||||
Log.d("Commons", "Called via onLayout");
|
|
||||||
loadImageIfNecessary(true);
|
loadImageIfNecessary(true);
|
||||||
// Called via onLayout
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue