Skip to content

Commit

Permalink
If we failed to get a default profile, fail the settings load (#1343)
Browse files Browse the repository at this point in the history
This stops the crash in #1318.
  • Loading branch information
DHowett authored Jun 20, 2019
1 parent 2015788 commit 66cb7c4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ std::unique_ptr<CascadiaSettings> CascadiaSettings::LoadAll(const bool saveOnLoa
}
resultPtr = FromJson(root);

if (resultPtr->GlobalSettings().GetDefaultProfile() == GUID{})

This comment has been minimized.

Copy link
@mauve

mauve Jun 20, 2019

Contributor

Wouldn't a better check be if a profile with the specified GUID exists? Unless I am mistaken it will catch this case, but also the case when an invalid profile has been specified as default profile?

This comment has been minimized.

Copy link
@DHowett-MSFT

DHowett-MSFT Jun 20, 2019

Contributor

Probably.

{
throw winrt::hresult_invalid_argument();
}

if (saveOnLoad)
{
// Logically compare the json we've parsed from the file to what
Expand Down

0 comments on commit 66cb7c4

Please sign in to comment.