Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
780
NullReferenceException clearing Series on Service Release
posted

Since upgrading to the 8/17 service release, I intermittently get a NullReferenceException when clearing out (or removing ont a time) old series:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Infragistics.Silverlight.Chart.XamWebChart.a(Object A_0, NotifyCollectionChangedEventArgs A_1)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index)
   at System.Collections.ObjectModel.Collection`1.Remove(T item)

System.NullReferenceException: Object reference not set to an instance of an object.
at Infragistics.Silverlight.Chart.XamWebChart.a(Object A_0, NotifyCollectionChangedEventArgs A_1)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
at System.Collections.ObjectModel.Collection`1.Clear()

I can't narrow down a small repro yet, but will keep trying.  I wanted to post to see if this was a known issue, or if you could notice anything from the stack trace to help me narrow it down or avoid it.

Thanks,
Keith

Parents
  • 780
    posted

    OK, here's a simple repro.  All code-behind.  This works fine on the 9.1 release, but appeared right after I upgraded to the service release. 

    FYI, If you comment out the Scene, it doesn't happen.

    public partial class SeriesClearRepro : UserControl
    {
        private XamWebChart chart;

        public SeriesClearRepro()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(SeriesClearRepro_Loaded);
        }

        void SeriesClearRepro_Loaded(object sender, RoutedEventArgs e)
        {
            ResetChart();
            ResetChart();
        }

        void ResetChart()
        {
            if (this.chart != null)
            {
                this.chart.Series.Clear();
                this.chart.Axes.Clear();
            }

            this.chart = new XamWebChart();
            this.chart.Scene = new Scene();
        }
    }

     

Reply Children