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