Fixed segfault that occurs when undoing while drawing

This commit is contained in:
Yousef Khadadeh 2025-07-23 17:21:56 +03:00
parent 0a8add3df1
commit 7f905f01df
5 changed files with 9 additions and 11 deletions

View file

@ -140,11 +140,11 @@ void RectDrawTool::tool_update() {
}
void RectDrawTool::commit_rectangle() {
if(controls.intermediateItem) {
if(controls.intermediateItem && controls.intermediateItem->collabListInfo.lock()) {
controls.intermediateItem->client_send_update_final(drawP);
controls.intermediateItem->final_update(drawP);
controls.intermediateItem = nullptr;
}
controls.intermediateItem = nullptr;
}
void RectDrawTool::draw(SkCanvas* canvas, const DrawData& drawData) {