diff options
author | Praga Siva <praga@users.noreply.github.com> | 2016-07-19 07:18:15 +0800 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-07-18 16:18:15 -0700 |
commit | 5268d609fafc142886700bd4b0d8bcb4f465a801 (patch) | |
tree | f764aeef31d36855f37f79bd41d4e9a5e24546e1 /Xamarin.Forms.Platform.iOS/Cells | |
parent | f304f25df2d80094d2c31fda4986f92454599a7e (diff) | |
download | xamarin-forms-5268d609fafc142886700bd4b0d8bcb4f465a801.tar.gz xamarin-forms-5268d609fafc142886700bd4b0d8bcb4f465a801.tar.bz2 xamarin-forms-5268d609fafc142886700bd4b0d8bcb4f465a801.zip |
Fix for NullReferenceException when ItemSource has item removed and a… (#258)
* fix for NullReferenceException when ItemSource has item removed and another inserted on iOS
* Update ViewCellRenderer.cs
Fix spacing issue
Diffstat (limited to 'Xamarin.Forms.Platform.iOS/Cells')
-rw-r--r-- | Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs index 47783ebb..852f455a 100644 --- a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs @@ -118,7 +118,10 @@ namespace Xamarin.Forms.Platform.iOS if (!_rendererRef.TryGetTarget(out renderer)) return base.SizeThatFits(size); - double width = size.Width; + if (renderer.Element == null) + return SizeF.Empty; + + double width = size.Width; var height = size.Height > 0 ? size.Height : double.PositiveInfinity; var result = renderer.Element.Measure(width, height); @@ -189,4 +192,4 @@ namespace Xamarin.Forms.Platform.iOS } } } -}
\ No newline at end of file +} |