Page 1 of 1

InvalidOperationException: Collection was modified; enumeration operation may not execute.

Posted: Wed Dec 28, 2022 9:08 pm
by Giezi
Hy

I upgraded to the latest version of ES3 and since then I get the following error when I save my data (still works, and I am not sure where the error exactly comes from):

Code: Select all

InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.Dictionary`2+Enumerator[TKey,TValue].MoveNext () (at <3dd5df5ef4974f29afeb2d3ba227c5da>:0)
System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () (at <6d8d8bfa07a94600b91503349e4a8e4f>:0)
ES3Internal.ES3ReferenceMgrBase.RemoveNullValues () (at Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs:362)
ES3Internal.ES3ReferenceMgrBase.Awake () (at Assets/Plugins/Easy Save 3/Scripts/ES3ReferenceMgrBase.cs:141)
Sorry if this is an obvious error, not sure what I'm missing.

Thanks!

Re: InvalidOperationException: Collection was modified; enumeration operation may not execute.

Posted: Thu Dec 29, 2022 8:34 am
by Joel
Hi there,

We had a similar error to this on 3.4.2, but this was resolved in 3.4.3.

If you’re on the very latest version and are still getting this error, please could you create a minimal project which replicates it and private message it to me with instructions.

All the best,
Joel

Re: InvalidOperationException: Collection was modified; enumeration operation may not execute.

Posted: Thu Dec 29, 2022 9:47 am
by Giezi
Thanks for the fast answer!

Looks like I'm on 3.5.3 which I believe is the last version on the asset store.

I will try, but the project I'm using it with is very big, it might take a while.

Thanks a lot!

Best
Giezi

Re: InvalidOperationException: Collection was modified; enumeration operation may not execute.

Posted: Thu Dec 29, 2022 9:54 am
by Joel
Hi Giezi,

Just before you go to too much effort in creating a minimal project, I've created a version which uses a slightly different method for RemoveNullValues() which might resolve the issue. I'll private message this over to you now.

All the best,
Joel