[PR #11428] Fix null pointer exceptions for default constructed CascadiaSettings instances #28573

Closed
opened 2026-01-31 09:29:21 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/11428

State: closed
Merged: Yes


CascadiaSettings is default constructed when human readable error messages are
returned. Even in such cases we need to ensure that all fields are properly
initialized, as a caller might decide to call a GlobalSettings getter.
Thus a crash occurred whenever a user was hot-reloading their settings file with
invalid JSON as other code then tried to compare the GlobalSettings().

PR Checklist

  • I work here
  • Tests added/passed

Validation Steps Performed

  • Start Windows Terminal and ensure the settings load fine
  • Add "commandline": 123 to any of the generated profiles in settings.json
  • The application doesn't crash and shows a warning message
**Original Pull Request:** https://github.com/microsoft/terminal/pull/11428 **State:** closed **Merged:** Yes --- `CascadiaSettings` is default constructed when human readable error messages are returned. Even in such cases we need to ensure that all fields are properly initialized, as a caller might decide to call a `GlobalSettings` getter. Thus a crash occurred whenever a user was hot-reloading their settings file with invalid JSON as other code then tried to compare the `GlobalSettings()`. ## PR Checklist * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Start Windows Terminal and ensure the settings load fine * Add `"commandline": 123` to any of the generated profiles in settings.json * The application doesn't crash and shows a warning message
claunia added the pull-request label 2026-01-31 09:29:21 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#28573