Skip to content

Commit 67e7f53

Browse files
committed
🐛 Fix deleting text displays throwing an error
1 parent 4a67ccf commit 67e7f53

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/outliner/textDisplay.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ export class TextDisplay extends ResizableOutlinerElement {
269269
text.isTextDisplayText = true
270270

271271
const mesh = this.mesh as THREE.Mesh
272+
if (!mesh) {
273+
console.warn('TextDisplay mesh not found')
274+
return
275+
}
272276
mesh.clear()
273277
delete mesh.sprite
274278
mesh.name = this.uuid
@@ -281,8 +285,6 @@ export class TextDisplay extends ResizableOutlinerElement {
281285
mesh.outline = outline
282286
mesh.add(outline)
283287
mesh.visible = this.visibility
284-
285-
return text
286288
}
287289
}
288290
TextDisplay.prototype.icon = TextDisplay.icon

0 commit comments

Comments
 (0)