Skip to content

Commit f6b39b5

Browse files
committed
Update whiteboard imports and pen drawing check
Changed import path for whiteboard types to use whiteboard-local module. Added a null check for points array before drawing pen elements to prevent potential runtime errors.
1 parent 5e38517 commit f6b39b5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/dashboard/whiteboard/[id]/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import {
2828
type DrawingElement,
2929
type Point,
3030
type Tool,
31-
} from "@/lib/features/whiteboard"
31+
} from "@/lib/features/whiteboard/whiteboard-local"
3232

3333
export default function WhiteboardEditorPage() {
3434
const params = useParams()
@@ -100,7 +100,7 @@ export default function WhiteboardEditorPage() {
100100

101101
switch (currentElement.type) {
102102
case "pen":
103-
if (currentElement.points.length > 1) {
103+
if (currentElement.points && currentElement.points.length > 1) {
104104
ctx.beginPath()
105105
ctx.moveTo(currentElement.points[0].x, currentElement.points[0].y)
106106
currentElement.points.forEach((p) => ctx.lineTo(p.x, p.y))

0 commit comments

Comments
 (0)