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
Error thrown when adding new value to a <string, int> dictionary through the ModConfig UI #692
Comments
String or string? string is null by default hence the error maybe. |
Yeah, I haven't written anything in C# for a while, so my bad with the capitalization. |
It was added in 0.11.4 |
It would be ideal if there was a default that it lied back on, but thank you! |
"ModConfig now supports default values for reference fields, greatly simplifying ModConfig code" |
And there is a default for primitive types int i; //implicitely 0
string s; //null |
This is a bug, thanks, fixed. Having to use DefaultDictionaryKeyValue is not intended. |
Description
Attempting to add a new field to a <String, int> dictionary through the ModConfig UI results in the error "Cannot populate JSON object onto type 'System.String'" thrown.
Log File
client.log
Steps to Reproduce
Expected behavior
A blank key mapped to a blank value should be added to the dictionary and displayed in the UI.
Actual behavior
The error "Cannot populate JSON object onto 'System.String'." is thrown and displayed in the notification bar. The dictionary and the UI are not noticeably modified in any other way.
Reproduction frequency
Consistently.
Additional Information
In issue #626, the sample mod I attached (DictionaryYikes.zip) which worked at the time it was created (tModLoader v0.11.3) now produces the same error consistently (tModLoader v0.11.5), meaning that this is likely not my own mistake.
The text was updated successfully, but these errors were encountered: