cmdpal: fix our settings load crash#47296
Conversation
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.Unrecognized words (1)DEFAULTTONEAREST These words are not needed and should be removeddefaulttonearestTo accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands... in a clone of the git@github.com:microsoft/PowerToys.git repository curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/25063981561/attempts/1' &&
git commit -m 'Update check-spelling metadata'OR To have the bot accept them for you, comment in the PR quoting the following line: If the flagged items are 🤯 false positivesIf items relate to a ...
|
Fixes a category of crashes in CmdPal, related to our settings parsing.
It would seem that I don't understand JSON parsing all that well in C#.
Basically, we've got a bunch of places where we have
but when we JSON deserialize the settings, if there wasn't a
"MySetting"key, then the deserializer deserializes tonull, notnew(). but sinceFoo.MySettingisn't aBar?, then the compiler can't check the fact that json gets special rules to write a null to it????Closes #47249
tested with the settings.json from that thread.