Check if object pointer is null before commit

This commit is contained in:
Yousef Khadadeh 2025-12-15 16:55:09 +03:00
parent 5daf1ce6c0
commit c57ea608c3
5 changed files with 25 additions and 17 deletions

View file

@ -97,10 +97,12 @@ bool EllipseDrawTool::prevent_undo_or_redo() {
}
void EllipseDrawTool::commit() {
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
containerPtr->commit_update(drawP);
containerPtr->send_comp_update(drawP, true);
objInfoBeingEdited = nullptr;
if(objInfoBeingEdited) {
NetworkingObjects::NetObjOwnerPtr<CanvasComponentContainer>& containerPtr = objInfoBeingEdited->obj;
containerPtr->commit_update(drawP);
containerPtr->send_comp_update(drawP, true);
objInfoBeingEdited = nullptr;
}
}
void EllipseDrawTool::draw(SkCanvas* canvas, const DrawData& drawData) {