This repository has been archived by the owner on May 1, 2024. It is now read-only.
[Bug] iOS CellView BindingContextChanged Event -> Null Reference Within ContextActions Clear() #11943
Labels
a/listview
Problems with the ListView/TableView
in-progress
This issue has an associated pull request that may resolve it!
p/iOS 🍎
t/bug 🐛
Projects
Milestone
Description
On iOS, a null reference exception get's thrown if ContextAction.Clear() is called within the BindingContextChanged callback
of a ViewCell within a ListView. The problem seems to only happen when scrolling a very large list and the RecycleElement Caching strategy is is used
This is probably related to #10934
Steps to Reproduce
i) Call ContextActions.Clear() within the callback
Expected Behavior
Don't crash when scrolling a listview (given that the list view's individual cells might have changing context actions)
Actual Behavior
App crashes with a null reference exception
Basic Information
Stack Trace
`
SIGABRT: Object reference not set to an instance of an object
ContextActionsCell.OnContextItemsChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) D:\a\1\s\Xamarin.Forms.Platform.iOS\ContextActionCell.cs:488
(wrapper delegate-invoke) .invoke_void_object_NotifyCollectionChangedEventArgs(object,System.Collections.Specialized.NotifyCollectionChangedEventArgs)
ObservableCollection
1[T].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) ObservableCollection
1[T].OnCollectionReset ()ObservableCollection
1[T].ClearItems () Collection
1[T].Clear ()TimesheetListItemViewCell.OnBindingContextChanged ()
`
The text was updated successfully, but these errors were encountered: