Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit f58da51

Browse files
fix: LSDV-4757: Fix brush crashing (#1248)
Fix brush crashing Co-authored-by: hlomzik <[email protected]>
1 parent eac80ba commit f58da51

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/tools/Brush.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ const _Tool = types
117117
},
118118

119119
updateCursor() {
120-
if (!self.selected || !self.obj.stageRef) return;
120+
if (!self.selected || !self.obj?.stageRef) return;
121121
const val = self.strokeWidth;
122122
const stage = self.obj.stageRef;
123123
const base64 = Canvas.brushSizeCircle(val);

src/tools/Erase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const _Tool = types
9696

9797
return {
9898
updateCursor() {
99-
if (!self.selected || !self.obj.stageRef) return;
99+
if (!self.selected || !self.obj?.stageRef) return;
100100
const val = 24;
101101
const stage = self.obj.stageRef;
102102
const base64 = Canvas.brushSizeCircle(val);

src/tools/Zoom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const _Tool = types
8989
},
9090

9191
updateCursor() {
92-
if (!self.selected || !self.obj.stageRef) return;
92+
if (!self.selected || !self.obj?.stageRef) return;
9393

9494
self.stageContainer.style.cursor = 'grab';
9595
},

0 commit comments

Comments
 (0)