summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Android
diff options
context:
space:
mode:
authorJimmy Garrido <jimmygarrido@outlook.com>2017-03-03 04:20:20 -0800
committerRui Marinho <me@ruimarinho.net>2017-03-03 12:20:20 +0000
commit97b28b1c20746bec32d8a1cd26f1c5d268d11680 (patch)
tree7e9ba02c0c12bf4136c1499d185d58bdb49266f7 /Xamarin.Forms.Platform.Android
parent81058db4f57982891904e7d8da68971ab4d91379 (diff)
downloadxamarin-forms-97b28b1c20746bec32d8a1cd26f1c5d268d11680.tar.gz
xamarin-forms-97b28b1c20746bec32d8a1cd26f1c5d268d11680.tar.bz2
xamarin-forms-97b28b1c20746bec32d8a1cd26f1c5d268d11680.zip
Throw exception when ViewCell View is null (#752)
Diffstat (limited to 'Xamarin.Forms.Platform.Android')
-rw-r--r--Xamarin.Forms.Platform.Android/Cells/ViewCellRenderer.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Android/Cells/ViewCellRenderer.cs b/Xamarin.Forms.Platform.Android/Cells/ViewCellRenderer.cs
index 9604364a..8134a9c1 100644
--- a/Xamarin.Forms.Platform.Android/Cells/ViewCellRenderer.cs
+++ b/Xamarin.Forms.Platform.Android/Cells/ViewCellRenderer.cs
@@ -2,6 +2,7 @@ using Android.Content;
using Android.Views;
using AView = Android.Views.View;
using Xamarin.Forms.Internals;
+using System;
namespace Xamarin.Forms.Platform.Android
{
@@ -32,6 +33,9 @@ namespace Xamarin.Forms.Platform.Android
rowHeight = ListView.RowHeightProperty;
}
+ if (cell.View == null)
+ throw new InvalidOperationException($"ViewCell must have a {nameof(cell.View)}");
+
IVisualElementRenderer view = Platform.CreateRenderer(cell.View);
Platform.SetRenderer(cell.View, view);
cell.View.IsPlatformEnabled = true;