InvalidOperationException: Operation is not valid due to the current state of the object
Hello everyone,
I encounter this issue, and have found threads talking about it as a bug in the editor, but it's not my case.
I am building a custom GUI Editor for some scriptable objects, and I use the
string absPath = EditorUtility.SaveFilePanel("Select Name and Path for Level", Application.dataPath + "/_Project/Levels/Data/Levels/", "New Level", "asset");
And after I select a folder, enter a name, and press Save, the error pops into Unity. I am guessing this has to do with the current unity Window index not being reset to anything so it goes to -1 and pops the error, but I have litteraly no clue how to fix this...
Any help would be appreciated.
Thanks a bunch
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612094737im_/https://answers.unity.com/themes/thub/images/avi.jpg)