Skip to content

Commit

Permalink
Only update render appearance settings if there's a renderer (#9798)
Browse files Browse the repository at this point in the history
I ran into this crash when I just opened a new tab.

Fixes MSFT-32485023

(cherry picked from commit dab52c4)
  • Loading branch information
DHowett committed Apr 13, 2021
1 parent f2afb22 commit 8078db5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/cascadia/TerminalControl/TermControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,14 @@ namespace winrt::Microsoft::Terminal::Control::implementation
// Update the terminal core with its new Core settings
_terminal->UpdateAppearance(newAppearance);

// Update DxEngine settings under the lock
_renderEngine->SetSelectionBackground(til::color{ newAppearance.SelectionBackground() });
_renderEngine->SetRetroTerminalEffect(newAppearance.RetroTerminalEffect());
_renderEngine->SetPixelShaderPath(newAppearance.PixelShaderPath());
_renderer->TriggerRedrawAll();
if (_renderEngine)
{
// Update DxEngine settings under the lock
_renderEngine->SetSelectionBackground(til::color{ newAppearance.SelectionBackground() });
_renderEngine->SetRetroTerminalEffect(newAppearance.RetroTerminalEffect());
_renderEngine->SetPixelShaderPath(newAppearance.PixelShaderPath());
_renderer->TriggerRedrawAll();
}
}

// Method Description:
Expand Down

0 comments on commit 8078db5

Please sign in to comment.