From b502d5dbb8fc11231c65d7ba2f72e98a588a447b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Wed, 9 Mar 2022 19:53:14 +0100 Subject: [PATCH] guard against broken SVG costumes when loading a project --- HISTORY.md | 2 ++ snap.html | 2 +- src/objects.js | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 21fdb984..36e8f2a3 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -5,6 +5,7 @@ * export / import sprite-local custom block definitions, under construction * **Notable Changes:** * **Notable Fixes:** + * guard against broken SVG costumes when loading a project * **Documentation Updates:** * **Translation Updates:** @@ -13,6 +14,7 @@ * byob, store, gui: export / import sprite-local custom block definitions, under construction * byob, gui: adapted library import dialog to the new format * byob: added collecting dependencies for sprite-local custom blocks +* objects: guard against broken SVG costumes when loading a project ## 7.3.0: * **New Features:** diff --git a/snap.html b/snap.html index f97b81b3..8fe7c0da 100755 --- a/snap.html +++ b/snap.html @@ -18,7 +18,7 @@ - + diff --git a/src/objects.js b/src/objects.js index b64c4879..7e85c45f 100644 --- a/src/objects.js +++ b/src/objects.js @@ -87,7 +87,7 @@ BlockVisibilityDialogMorph, CostumeIconMorph, SoundIconMorph*/ /*jshint esversion: 6*/ -modules.objects = '2022-March-04'; +modules.objects = '2022-March-09'; var SpriteMorph; var StageMorph; @@ -10352,11 +10352,11 @@ Costume.prototype.center = function () { }; Costume.prototype.width = function () { - return this.contents.width; + return this.contents ? this.contents.width : 0; }; Costume.prototype.height = function () { - return this.contents.height; + return this.contents ? this.contents.height : 0; }; Costume.prototype.bounds = function () {