Skip to content

Commit a64d747

Browse files
committed
clearMask(true) would throw an exception if the Game Object didn't have a mask. Now it checks first before destroying the mask. Fix phaserjs#3809
1 parent 1931716 commit a64d747

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,13 @@ There is a new Game Object Component called `TextureCrop`. It replaces the Textu
124124
* Added the Mask component to Container. It worked without it, but this brings it in-line with the documentation and other Game Objects. Fix #3797 (thanks @zilbuz)
125125
* The DataManager couldn't redefine previously removed properties. Fix #3803 (thanks @AleBles @oo7ph)
126126
* The Canvas DrawImage function has been recoded entirely so it now correctly supports parent matrix and camera matrix calculations. This fixes an issue where children inside Containers would lose their rotation, and other issues, when in the Canvas Renderer. Fix #3728 (thanks @samid737)
127+
* `clearMask(true)` would throw an exception if the Game Object didn't have a mask. Now it checks first before destroying the mask. Fix #3809 (thanks @NokFrt)
127128

128129
### Examples, Documentation and TypeScript
129130

130131
My thanks to the following for helping with the Phaser 3 Examples, Docs and TypeScript definitions, either by reporting errors, fixing them or helping author the docs:
131132

132-
@DannyT @squilibob @dvdbrink @t1gu1 @cyantree @DrevanTonder @mikewesthad
133+
@DannyT @squilibob @dvdbrink @t1gu1 @cyantree @DrevanTonder @mikewesthad @tarsupin
133134

134135
Also, a special mention to @andygroff for his excellent work enhancing the search box on the examples site, and @hexus for his assistance completing the documentation for the Game Objects.
135136

src/gameobjects/components/Mask.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var Mask = {
6363
{
6464
if (destroyMask === undefined) { destroyMask = false; }
6565

66-
if (destroyMask)
66+
if (destroyMask && this.mask)
6767
{
6868
this.mask.destroy();
6969
}

0 commit comments

Comments
 (0)