Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Index out of bound exception #122

Open
HarshitPradhan opened this issue Sep 12, 2023 · 0 comments
Open

Index out of bound exception #122

HarshitPradhan opened this issue Sep 12, 2023 · 0 comments
Labels
status: triage Needs to be triaged type: bug Something isn't working

Comments

@HarshitPradhan
Copy link

HarshitPradhan commented Sep 12, 2023

Bug description

While working on my application it's a once in a lifetime scenario that I've encountered this exception and I'm unable to figure it out why this error came and how to fix this error.

This is the message that I have received

RefreshCountingFromThread Thread Exception : Index was outside the bounds of the array.: at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at MvvmBlazor.Internal.WeakEventListener.WeakEventManager.AddWeakEventListener[T](T source, Action2 handler)
at MvvmBlazor.Internal.Bindings.Binding.AddCollectionBindings()
at MvvmBlazor.Internal.Bindings.Binding.SourceOnPropertyChanged(Object sender, PropertyChangedEventArgs e)
at MvvmBlazor.Internal.WeakEventListener.WeakEventListenerBase`2.HandleEvent(Object sender, TArgs e)
at MvvmBlazor.ViewModel.ViewModelBase.OnPropertyChanged(String propertyName)
at MvvmBlazor.ViewModel.ViewModelBase.Set[T](T& field, T value, String propertyName)
at <ViewModel_Full_Path>.UpdateDetailView()

Expectation

How to not get this exception again as the application is used by many clients and the application is deployed in the field already.

Code sample

public ObservableCollection<DetailDataDTO> DetailsData
{
    get { return detailsData; }
    set { Set(ref detailsData, value); }
}

private ObservableCollection<DetailDataDTO> detailsData;

private void UpdateDetailView()
{
	...
	...
	...
	this.DetailsData = this.DataInventory.GetDetailsData();
	...
	...
	...
}

Version

2.0.0

Are you using Blazor WASM or Blazor Server?

Blazor Server

What operation system are you working with?

Linux

@HarshitPradhan HarshitPradhan added status: triage Needs to be triaged type: bug Something isn't working labels Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: triage Needs to be triaged type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant