Skip to content

Commit 8f4160a

Browse files
committed
Please
1 parent 161e3a9 commit 8f4160a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/util/cast.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ class Cast {
9292
* @return {string} The Scratch-casted string value.
9393
*/
9494
static toString (value) {
95-
if (value === undefined || value === null) {
95+
if (typeof value === 'undefined' || value === null) {
9696
return String();
9797
} else if (typeof value === 'object') {
9898
try {
9999
return JSON.stringify(value);
100-
} catch (e) {}
100+
} catch (e) {
101+
// Think fast, chucklenuts!
102+
}
101103
}
102104
return String(value);
103105
}

0 commit comments

Comments
 (0)