Skip to content

Commit

Permalink
Make sure the command palette isn't null (#15220)
Browse files Browse the repository at this point in the history
Fixes a crash when pressing a keybinding in the settings tab. 

Regressed in #15196.

Noted in #14051
  • Loading branch information
zadjii-msft authored Apr 21, 2023
1 parent 210414e commit 4788347
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/TerminalPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ namespace winrt::TerminalApp::implementation
return;
}

if (const auto p = CommandPaletteElement(); p.Visibility() == Visibility::Visible && cmd.ActionAndArgs().Action() != ShortcutAction::ToggleCommandPalette)
if (const auto p = CommandPaletteElement(); p && p.Visibility() == Visibility::Visible && cmd.ActionAndArgs().Action() != ShortcutAction::ToggleCommandPalette)
{
p.Visibility(Visibility::Collapsed);
}
Expand Down

0 comments on commit 4788347

Please sign in to comment.