Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling DBCDStorage.Save() twice causes an ArgumentException #26

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

KalopsiaTwilight
Copy link
Contributor

Because the Storage is not cleared after a Save() as it is in the constructor for a DBCDStorage, calling this method twice will result in an attempt to add the same keys to the underlying dictionary, which causes an ArgumentException.

This PR fixes the ArgumentException by clearing the Storage after the Save() operation similar to how it is cleared in the constructor after loading.

See also the added test for the minimal reproducible scenario this PR fixes, current test will fail with an ArgumentException in DBCD 2.0.1.

@Marlamin Marlamin merged commit a02ce06 into wowdev:master Aug 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants