We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Null reference exception in Badge renderer

Thread ID:





150240 Dec 27,2019 03:46 PM UTC Dec 31,2019 02:27 PM UTC Xamarin.iOS 2
Tags: General
Another XamarinDev
Asked On December 27, 2019 03:46 PM UTC

Again, happening when badge is in listview, and been scrolled down and back up and source replaced/ updated. Cannot provide exact way to repro but it's similar problem with disposed object
SfBadgeView.CalculateBadgeSize ()

does not take in account it can be already disposed and renderer is null, but the main problem is in list view calling to render disposed records

  • SfBadgeView.CalculateBadgeSize ()
  • IBadgeDependencyService.SetBadgeSize (System.Object nativeView, Syncfusion.XForms.BadgeView.SfBadgeView badgeView)
  • SfBadgeView.OnMeasure (System.Double widthConstraint, System.Double heightConstraint)
  • VisualElement.GetSizeRequest (System.Double widthConstraint, System.Double heightConstraint)

  • MeasureSize.CalculateSize (Syncfusion.ListView.XForms.SfListView listview, Xamarin.Forms.View content, Xamarin.Forms.Size viewSize, System.Boolean isMeasureInvalidated)
  • LayoutBase.GetAutoFitItemSize (Syncfusion.ListView.XForms.ListViewItemInfoBase itemInfo, System.Double& itemSize, System.Double itemSpacing, System.Int32 spanCount)
  • LinearLayout.GetAutoFitItemSize (Syncfusion.ListView.XForms.ListViewItemInfoBase itemInfo, System.Double& itemSize, System.Double itemSpacing)
  • LinearLayout.SetRowHeight (Syncfusion.ListView.XForms.ListViewItemInfo itemInfo, System.Int32 index, System.Double& size, System.Double itemSpacing)
  • LinearLayout.SetRowHeight (Syncfusion.ListView.XForms.ListViewItemInfo itemInfo, System.Double itemSpacing)
  • LinearLayout.EnsureItems (Syncfusion.GridCommon.ScrollAxis.VisibleLinesCollection visibleLines)
  • VisualContainer.EnsureItems ()
  • VisualContainer.OnSizeAllocated (System.Double width, System.Double height)
  • VisualElement.SizeAllocated (System.Double width, System.Double height)

  • SfListViewHelper.InvalidateForceLayout (Xamarin.Forms.Layout`1[T] view)
  • SfListView.RefreshView (System.Boolean canResetRowHeight)
  • SfListView.RefreshView ()

  • Ramya Soundar Rajan [Syncfusion]
    Replied On December 31, 2019 02:18 PM UTC

    Hi Ilya,  
    Greeting from Syncfusion. 
    We have prepared the simple sample by placing the SfBadgeView inside the ListView and checked the reported crash. But we afraid that, we are not able to reproduce the reported issue in our side. However, we have fixed the issue using the provided stack trace. Please find the custom assembly for the issue and can be downloaded from the below link.    
    Please confirm us whether these assemblies resolved the reported crash at your end. 
    Ramya S 

    Ramya Soundar Rajan [Syncfusion]
    Replied On December 31, 2019 02:27 PM UTC

    Hi Ilya, 
    In our last update, we have missed to add disclaimer details. Please find the details below. 
    Assembly Version: 
    Please note that we have created this assembly for version specifically to resolve the issue reported in the forum 150240. If you have received other patches for the same version for other products, please apply all assembly in the order received.  
    Ramya S 


    This post will be permanently deleted. Are you sure you want to continue?

    Sorry, An error occured while processing your request. Please try again later.

    Please sign in to access our forum

    This page will automatically be redirected to the sign-in page in 10 seconds.

    Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

    Live Chat Icon For mobile
    Live Chat Icon