Bug 36804 - NullReferenceException when ListView has items added to it
Summary: NullReferenceException when ListView has items added to it
Status: RESOLVED NORESPONSE
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-12-10 03:26 UTC by Stuart Campbell
Modified: 2016-04-13 18:39 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NORESPONSE

Description Stuart Campbell 2015-12-10 03:26:35 UTC
Upgraded to latest 2.0.0.6490 and now a ListView that has been working in previous versions of XF is now causing a crash when new list items are added to it.

The ListView and an ItemTemplate are defined in XAML, bound to an ObservableCollection of ViewModels.

Stack:

  at Xamarin.Forms.VisualElement+<>c.<.cctor>b__208_2 (Xamarin.Forms.BindableObject bindable, System.Object oldvalue, System.Object newvalue) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindablePropertyContext context, System.Object value, Boolean currentlyApplying, SetValueFlags attributes, Boolean silent) [0x0010e] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes) [0x0014b] in <filename unknown>:0 
  at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, Boolean fromTarget) [0x0020b] in <filename unknown>:0 
  at Xamarin.Forms.BindingExpression.Apply (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property) [0x0006b] in <filename unknown>:0 
  at Xamarin.Forms.Binding.Apply (System.Object newContext, Xamarin.Forms.BindableObject bindObj, Xamarin.Forms.BindableProperty targetProperty) [0x00042] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding, Boolean fromStyle) [0x000af] in <filename unknown>:0 
  at Xamarin.Forms.BindableObject.SetBinding (Xamarin.Forms.BindableProperty targetProperty, Xamarin.Forms.BindingBase binding) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.Xaml.ApplyPropertiesVisitor.SetPropertyValue (System.Object xamlelement, XmlName propertyName, System.Object value, Xamarin.Forms.BindableObject rootElement, INode node, Xamarin.Forms.Xaml.HydratationContext context, IXmlLineInfo lineInfo) [0x001d6] in <filename unknown>:0 
  at Xamarin.Forms.Xaml.ApplyPropertiesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, INode parentNode) [0x000cb] in <filename unknown>:0 
  at Xamarin.Forms.Xaml.ElementNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x000b1] in <filename unknown>:0 
  at Xamarin.Forms.Xaml.ElementNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00054] in <filename unknown>:0 
  at Xamarin.Forms.Xaml.ElementNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00089] in <filename unknown>:0 
  at Xamarin.Forms.Xaml.ElementNode.Accept (IXamlNodeVisitor visitor, INode parentNode) [0x00054] in <filename unknown>:0 
  at Xamarin.Forms.Xaml.ApplyPropertiesVisitor+<>c__DisplayClass26_0.<SetDataTemplate>b__0 () [0x00094] in <filename unknown>:0 
  at Xamarin.Forms.DataTemplate.CreateContent () [0x00019] in <filename unknown>:0 
  at Xamarin.Forms.TemplatedItemsList`2[TView,TItem].CreateContent (Int32 index, System.Object item, Boolean insert) [0x00021] in <filename unknown>:0 
  at Xamarin.Forms.TemplatedItemsList`2[TView,TItem].ConvertContent (Int32 startingIndex, IList items, Boolean forceCreate, Boolean setIndex) [0x00020] in <filename unknown>:0 
  at Xamarin.Forms.TemplatedItemsList`2[TView,TItem].OnProxyCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e, Boolean fixWindows) [0x0018b] in <filename unknown>:0 
  at Xamarin.Forms.TemplatedItemsList`2[TView,TItem].OnProxyCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>:0 
  at Xamarin.Forms.ListProxy.OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x0000a] in <filename unknown>:0 
  at Xamarin.Forms.ListProxy+<>c__DisplayClass52_0.<OnCollectionChanged>b__0 () [0x00018] in <filename unknown>:0 
  at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/src/Foundation/NSAction.cs:163 
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/src/UIKit/UIApplication.cs:77 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/2356/3c0ec355/source/maccore/src/UIKit/UIApplication.cs:61 
  at *redacted*.Main (System.String[] args) [0x0001f] in *redacted*/Main.cs:32
Comment 1 Paul DiPietro [MSFT] 2015-12-10 18:52:15 UTC
A reproduction project would be very helpful in investigating the issue.
Comment 2 Samantha Houts [MSFT] 2016-04-13 18:39:26 UTC
Thank you for your bug report. As we have not received the information requested, we cannot properly triage your bug and are marking it resolved.

Warm regards,
Xamarin Forms Team