[Android] Add null check before creating and drawing canvas bugzilla 55559 & 45602...
authorKoen Hendriks <koenhendriks89@gmail.com>
Thu, 4 May 2017 14:08:30 +0000 (16:08 +0200)
committerRui Marinho <me@ruimarinho.net>
Thu, 4 May 2017 14:08:30 +0000 (15:08 +0100)
* [Android] Add null check before creating and drawing canvas bugzilla 55559 & bugzilla 45602.

* [Android] REFACTOR Add null check before creating and drawing canvas bugzilla 55559 & 45602 #899

Xamarin.Forms.Platform.Android/Renderers/FrameRenderer.cs

index 921c654..9c84b62 100644 (file)
@@ -188,6 +188,9 @@ namespace Xamarin.Forms.Platform.Android
                                        e.PropertyName == Frame.OutlineColorProperty.PropertyName ||
                                        e.PropertyName == Frame.CornerRadiusProperty.PropertyName)
                                {
+                                       if(_normalBitmap == null)
+                                               return;
+                                               
                                        using (var canvas = new ACanvas(_normalBitmap))
                                        {
                                                int width = Bounds.Width();