summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.iOS
diff options
context:
space:
mode:
authorSamantha Houts <samhouts@users.noreply.github.com>2017-04-25 18:14:16 (GMT)
committerJason Smith <jason.smith@xamarin.com>2017-04-25 18:14:16 (GMT)
commit17c7d8ed5c4c629b5a235bad4c66400e534f0615 (patch)
treebd65d252adf76bc19fb4e46a64186fc1882554c8 /Xamarin.Forms.Platform.iOS
parent9b49e3f1c1f82a05bb1f282cd5b251228a357ae7 (diff)
downloadxamarin-forms-17c7d8ed5c4c629b5a235bad4c66400e534f0615.zip
xamarin-forms-17c7d8ed5c4c629b5a235bad4c66400e534f0615.tar.gz
xamarin-forms-17c7d8ed5c4c629b5a235bad4c66400e534f0615.tar.bz2
[iOS] Prevent NRE in ListView OnItemSelected (#883)
* Add repro * [iOS] Prevent NRE in ListView * [Android] Prevent NRE in ListView Not observed, but adding defensive check just in case
Diffstat (limited to 'Xamarin.Forms.Platform.iOS')
-rw-r--r--Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs3
1 files changed, 3 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs
index 2a20a67..d060e7f 100644
--- a/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs
+++ b/Xamarin.Forms.Platform.iOS/Renderers/ListViewRenderer.cs
@@ -868,6 +868,9 @@ namespace Xamarin.Forms.Platform.iOS
return;
}
+ if (List == null)
+ return;
+
var location = TemplatedItemsView.TemplatedItems.GetGroupAndIndexOfItem(eventArg.SelectedItem);
if (location.Item1 == -1 || location.Item2 == -1)
{