diff --git a/HISTORY.md b/HISTORY.md index c8d0750b..7d3b6b7e 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -23,6 +23,7 @@ * animation library: fixed pen state for GLIDE, thanks, Brian! * threads: addressed security issues in the JIT-compiler, thanks, xBZZZZ! * gui: show project name in browser tab, thanks, Peter! +* objects: handle (some cases of) extent-less costumes ### 2022-03-03 * SciSnap2 extension update (FFT), thanks, Eckart! diff --git a/src/objects.js b/src/objects.js index f0ef78d7..b64c4879 100644 --- a/src/objects.js +++ b/src/objects.js @@ -3824,6 +3824,10 @@ SpriteMorph.prototype.wearCostume = function (costume, noShadow) { y = this.yPosition ? this.yPosition() : null, idx = isNil(costume) ? null : this.costumes.asArray().indexOf(costume); + if (costume && (!costume.width() || !costume.height())) { + costume = null; + idx = null; + } this.changed(); this.costume = costume; this.fixLayout();