Skip to content

Commit 58d37b5

Browse files
committed
Fixed canvas destroy if undefined.
1 parent ef3cb1f commit 58d37b5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/gameobjects/Text.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ Phaser.Text.prototype.destroy = function (destroyChildren) {
140140

141141
this.texture.destroy(true);
142142

143-
if (this.canvas.parentNode)
143+
if (this.canvas && this.canvas.parentNode)
144144
{
145145
this.canvas.parentNode.removeChild(this.canvas);
146146
}

0 commit comments

Comments
 (0)