summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorSamantha Houts <samantha@teamredwall.com>2017-03-08 02:21:15 -0800
committerRui Marinho <me@ruimarinho.net>2017-03-08 10:21:15 +0000
commit1b39d02dfa11ac53efb3a8f7668640e03a10194c (patch)
tree871ec40e19a5687074c0d50fe7846c1ab9e4dbae /Xamarin.Forms.Platform.Android
parente6d5186c8acbf37b877c7ca3c77a378352a3743d (diff)
downloadxamarin-forms-1b39d02dfa11ac53efb3a8f7668640e03a10194c.tar.gz
xamarin-forms-1b39d02dfa11ac53efb3a8f7668640e03a10194c.tar.bz2
xamarin-forms-1b39d02dfa11ac53efb3a8f7668640e03a10194c.zip
[Android] Add null checks to ActivityIndicator (#804)
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/Renderers/ActivityIndicatorRenderer.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.Android/Renderers/ActivityIndicatorRenderer.cs b/Xamarin.Forms.Platform.Android/Renderers/ActivityIndicatorRenderer.cs
index f536b47e..17b9cc88 100644
--- a/Xamarin.Forms.Platform.Android/Renderers/ActivityIndicatorRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Renderers/ActivityIndicatorRenderer.cs
@@ -45,16 +45,22 @@ namespace Xamarin.Forms.Platform.Android
void UpdateColor()
{
+ if (Element == null || Control == null)
+ return;
+
Color color = Element.Color;
if (!color.IsDefault)
- Control.IndeterminateDrawable.SetColorFilter(color.ToAndroid(), PorterDuff.Mode.SrcIn);
+ Control.IndeterminateDrawable?.SetColorFilter(color.ToAndroid(), PorterDuff.Mode.SrcIn);
else
- Control.IndeterminateDrawable.ClearColorFilter();
+ Control.IndeterminateDrawable?.ClearColorFilter();
}
void UpdateVisibility()
{
+ if (Element == null || Control == null)
+ return;
+
Control.Visibility = Element.IsRunning ? ViewStates.Visible : ViewStates.Invisible;
}
}