Let's assume I have a method:
private ObservableCollectionExtended<Record> myCollection;
public void SetLoadingProperty(bool isLoading)
{
if (!myCollection?.Any() ?? false)
return;
foreach(var record in myCollection)
{
record.IsLoading = isLoading;
}
}
Is there any circumstance under which I get NullReferenceException for myCollection
being null in the foreach loop?