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

@ -96,10 +96,12 @@ bool RectDrawTool::prevent_undo_or_redo() {
}
void RectDrawTool::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 RectDrawTool::draw(SkCanvas* canvas, const DrawData& drawData) {