AutoFitMode="Height" crash on back button pressed when SfListView is dispossed

It looks like that  missing a null control in  auto fit mode function as you can see the exception message below. It is probably a rare scenario but in my case, I have SfListView whose itemsource is changed dynamically in the background. So I am using it like roadmap. If the user presses back button while I am raising property changed on itemsource. This error is appearing because obviously ListView is disposed and at the same time it tries to calculate size of the item. Please add a null check if list or item is null, dont calculate it.

System.NullReferenceExceptionObject reference not set to an instance of an object.

  at Syncfusion.ListView.XForms.Android.MeasureSize.Convert (Xamarin.Forms.View view, Xamarin.Forms.VisualElement valid) [0x0002d] in <1c388d604ec64a4288068581d0737135>:0 
  at Syncfusion.ListView.XForms.Android.MeasureSize.CalculateSize (Syncfusion.ListView.XForms.SfListView listview, Xamarin.Forms.View content, Xamarin.Forms.Size viewSize) [0x0000a] in <1c388d604ec64a4288068581d0737135>:0 
  at Syncfusion.ListView.XForms.LayoutBase.GetAutoFitItemSize (Syncfusion.ListView.XForms.ListViewItemInfoBase itemInfo, System.Double& itemSize, System.Double itemSpacing, System.Int32 spanCount) [0x000a1] in <9723873943804942baab770e25a04a31>:0 
  at Syncfusion.ListView.XForms.LinearLayout.GetAutoFitItemSize (Syncfusion.ListView.XForms.ListViewItemInfoBase itemInfo, System.Double& itemSize, System.Double itemSpacing) [0x00000] in <9723873943804942baab770e25a04a31>:0 
  at Syncfusion.ListView.XForms.LinearLayout.SetRowHeight (Syncfusion.ListView.XForms.ListViewItemInfo itemInfo, System.Int32 index, System.Double& size, System.Double itemSpacing) [0x00011] in <9723873943804942baab770e25a04a31>:0 
  at Syncfusion.ListView.XForms.LinearLayout.SetRowHeight (Syncfusion.ListView.XForms.ListViewItemInfo itemInfo, System.Double itemSpacing) [0x0008e] in <9723873943804942baab770e25a04a31>:0 
  at Syncfusion.ListView.XForms.LinearLayout.EnsureItems (Syncfusion.GridCommon.ScrollAxis.VisibleLinesCollection visibleLines) [0x002ab] in <9723873943804942baab770e25a04a31>:0 
  at Syncfusion.ListView.XForms.VisualContainer.EnsureItems () [0x0002b] in <9723873943804942baab770e25a04a31>:0 
  at Syncfusion.ListView.XForms.VisualContainer.OnSizeAllocated (System.Double width, System.Double height) [0x0003f] in <9723873943804942baab770e25a04a31>:0 
  at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\VisualElement.cs:637 
  at Xamarin.Forms.Layout.ForceLayout () [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\Layout.cs:115 
  at Syncfusion.ListView.XForms.SfListView.RefreshView () [0x00036] in <9723873943804942baab770e25a04a31>:0 
  at Syncfusion.ListView.XForms.SfListView.OnItemsSourceChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x00060] in <9723873943804942baab770e25a04a31>:0 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00108] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:596 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:390 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:174 
  at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:56 
  at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__47_0 () [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:551 
  at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <c82a099136944d8aa96281cf061cbc12>:0 
  at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <c82a099136944d8aa96281cf061cbc12>:0 
  at (wrapper dynamic-method) System.Object:5cc084e2-31f5-4946-bfdf-a8eb2fd2796e (intptr,intptr)

1 Reply

MK Muthu Kumaran Gnanavinayagam Syncfusion Team October 16, 2017 10:25 AM UTC

Hi Emil, 
 
A support incident has been created under your account to track the status of the reported query. Please log on to our support website to check for further updates.      
   
 
Regards, 
G. Muthu Kumaran. 


Loader.
Up arrow icon