ArgumentException

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
Jason
Posts: 7
Joined: Wed Apr 16, 2014 6:17 am

ArgumentException

Post by Jason »

Hi there!

I'm getting this error for whatever reason:

ArgumentException: An element with the same key already exists in the dictionary.
System.Collections.Generic.Dictionary`2[System.String,System.Object].Add (System.String key, System.Object value) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
ES2Data.Add (System.String tag, System.Object value)
ES2Reader.ReadAll ()
ES2.LoadAll (System.String path)
GameManager.ReadData () (at Assets/Code/GameManager.cs:290)
GameManager.Awake () (at Assets/Code/GameManager.cs:205)

My code for loading this data is simply this:

Code: Select all

public void ReadData()
{
	string path = _worlds.CurrentWorld + "/Data.txt";
	
	if (ES2.Exists(path))
	{
		ES2Data data = ES2.LoadAll(path);

		if (OnLoad != null)
			OnLoad(data);
	}
}
Where it triggers an event and passes the data object to listeners, which can use it to load their specific data out of it.

I'm not entirely sure which details I can give, because I have no idea what is causing this error or where it's happening. It seems to be happening internally in that ES2Data.Add method, where the tag is a duplicate.

Is there a way I could have caused this error, or is it an Easy Save bug?

Thanks in advance.
User avatar
Joel
Moodkie Staff
Posts: 4852
Joined: Wed Nov 07, 2012 10:32 pm

Re: ArgumentException

Post by Joel »

Hi Jason,

This appears to be a bug at our end, but it will be fixed in v2.54 which is currently awaiting approval from Unity.

All the best,
Joel
Locked