diff options
author | Samantha Houts <samhouts@users.noreply.github.com> | 2017-04-25 11:14:16 -0700 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2017-04-25 11:14:16 -0700 |
commit | 17c7d8ed5c4c629b5a235bad4c66400e534f0615 (patch) | |
tree | bd65d252adf76bc19fb4e46a64186fc1882554c8 /Xamarin.Forms.Platform.iOS | |
parent | 9b49e3f1c1f82a05bb1f282cd5b251228a357ae7 (diff) | |
download | xamarin-forms-17c7d8ed5c4c629b5a235bad4c66400e534f0615.tar.gz xamarin-forms-17c7d8ed5c4c629b5a235bad4c66400e534f0615.tar.bz2 xamarin-forms-17c7d8ed5c4c629b5a235bad4c66400e534f0615.zip |
[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.cs | 3 |
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 2a20a670..d060e7f5 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) { |