Fix crash when closing and quickly opening a split, then running /clearmessages (#3852)

This commit is contained in:
Daniel Sage
2022-07-10 09:08:20 -04:00
committed by GitHub
parent e1b512a373
commit 965b06677a
3 changed files with 8 additions and 2 deletions
@@ -932,7 +932,11 @@ void CommandController::initialize(Settings &, Paths &paths)
auto *currentPage = dynamic_cast<SplitContainer *>(
getApp()->windows->getMainWindow().getNotebook().getSelectedPage());
currentPage->getSelectedSplit()->getChannelView().clearMessages();
if (auto split = currentPage->getSelectedSplit())
{
split->getChannelView().clearMessages();
}
return "";
});