From 66cb7c4b58b0e41ffaeb952ef27f1a8c67e90db8 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett (MSFT)" Date: Thu, 20 Jun 2019 11:20:49 -0700 Subject: [PATCH] If we failed to get a default profile, fail the settings load (#1343) This stops the crash in #1318. --- src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp b/src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp index 0f241770442..ee1d18ab93c 100644 --- a/src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp +++ b/src/cascadia/TerminalApp/CascadiaSettingsSerialization.cpp @@ -65,6 +65,11 @@ std::unique_ptr CascadiaSettings::LoadAll(const bool saveOnLoa } resultPtr = FromJson(root); + if (resultPtr->GlobalSettings().GetDefaultProfile() == GUID{}) + { + throw winrt::hresult_invalid_argument(); + } + if (saveOnLoad) { // Logically compare the json we've parsed from the file to what