From d1fb1799ba20d05c027f24f8bbc5d17adae9908b Mon Sep 17 00:00:00 2001 From: Steve Bilogan Date: Mon, 29 Aug 2022 21:28:41 -0400 Subject: [PATCH] fix(NavigationBar): Avoid null BitmapIcon.UriSource --- .../Controls/NavigationBar/AppBarButtonRenderer.Android.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Uno.Toolkit.UI/Controls/NavigationBar/AppBarButtonRenderer.Android.cs b/src/Uno.Toolkit.UI/Controls/NavigationBar/AppBarButtonRenderer.Android.cs index eb0d41b5c..d60920970 100644 --- a/src/Uno.Toolkit.UI/Controls/NavigationBar/AppBarButtonRenderer.Android.cs +++ b/src/Uno.Toolkit.UI/Controls/NavigationBar/AppBarButtonRenderer.Android.cs @@ -130,8 +130,11 @@ protected override void Render() switch (element.Icon) { case BitmapIcon bitmap: - var drawable = DrawableHelper.FromUri(bitmap.UriSource); - native?.SetIcon(drawable); + if (bitmap.UriSource is { } uriSource) + { + var drawable = DrawableHelper.FromUri(uriSource); + native?.SetIcon(drawable); + } break; case FontIcon font: // not supported