ModSettingsData.cs FormattedName(string) can't handle empty strings

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

ModSettingsData.cs FormattedName(string) can't handle empty strings

Post by DunnyOfPenwick »

...throws an InvalidOperationException if the value is an empty literal "".
<edit> Also, literals containing just spaces " " due to trimming.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: ModSettingsData.cs FormattedName(string) can't handle empty strings

Post by Interkarma »

ModSettingsData.FormattedName() is used to generate a name for a key. This should never be null or empty. It's reasonable that it would throw an exception of one kind or another.

What are you trying to accomplish by using an empty string here?

User avatar
DunnyOfPenwick
Posts: 275
Joined: Wed Apr 14, 2021 1:58 am
Location: Southeast US

Re: ModSettingsData.cs FormattedName(string) can't handle empty strings

Post by DunnyOfPenwick »

The text for my mod settings labels is being pulled from textdatabase.txt.

I am attempting to use several empty section titles to add padding to the bottom of the displayed column.

<edit>I can work around this just by using a dot or something, you can ignore this 'bug report'.

Post Reply