Skip to content

cmdpal: fix our settings load crash#47296

Merged
zadjii-msft merged 2 commits intomainfrom
dev/migrie/b/0.10-crashy-boom-boom
Apr 28, 2026
Merged

cmdpal: fix our settings load crash#47296
zadjii-msft merged 2 commits intomainfrom
dev/migrie/b/0.10-crashy-boom-boom

Conversation

@zadjii-msft
Copy link
Copy Markdown
Member

@zadjii-msft zadjii-msft commented Apr 28, 2026

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

class Foo
{
  public Bar MySetting {get;init;} = new()
}

but when we JSON deserialize the settings, if there wasn't a "MySetting" key, then the deserializer deserializes to null, not new(). but since Foo.MySetting isn't a Bar?, 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.

@github-actions
Copy link
Copy Markdown

@check-spelling-bot Report

🔴 Please review

See 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 removed defaulttonearest

To 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
on the dev/migrie/b/0.10-crashy-boom-boom branch (ℹ️ how do I use this?):

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:
@check-spelling-bot apply updates.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@zadjii-msft zadjii-msft merged commit 7211f7e into main Apr 28, 2026
15 checks passed
@zadjii-msft zadjii-msft deleted the dev/migrie/b/0.10-crashy-boom-boom branch April 28, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Command Palette crashes on launch!

3 participants