Minor cold clean up to avoid unnecessary code execution

This commit is contained in:
Ahmed Aderopo Alejo 2017-05-20 19:58:14 -03:00 committed by GitHub
parent c551d1fcf9
commit 835729035b

View File

@ -12,17 +12,17 @@ namespace eShopOnContainers.Droid.Renderers
{
base.OnLayout(changed, l, t, r, b);
if (Element.CurrentPage == null)
{
return;
}
var toolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
if (toolbar != null)
{
var image = toolbar.FindViewById<ImageView>(Resource.Id.toolbar_image);
if (Element.CurrentPage == null)
{
return;
}
if (!string.IsNullOrEmpty(Element.CurrentPage.Title))
image.Visibility = Android.Views.ViewStates.Invisible;
else
@ -30,4 +30,4 @@ namespace eShopOnContainers.Droid.Renderers
}
}
}
}
}