Fix a null pointer dereference spotted by coverity

This commit is contained in:
Juergen Spitzmueller 2021-01-30 13:46:47 +01:00
parent c83526c3ca
commit be14b73787

View File

@ -2944,7 +2944,9 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
undo().recordUndoBufferParams(CursorData());
branch_list.add(branch_name);
branch = branch_list.find(branch_name);
branch->setColors("background", "background");
if (branch)
// needed to update the color table for dark mode
branch->setColors("background", "background");
dr.setError(false);
dr.screenUpdate(Update::Force);
}