Skip to content

Commit fafa481

Browse files
author
Miyo Sho
committed
Fix cyclic objects in Cast.toString
1 parent 25d5e48 commit fafa481

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/util/cast.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ class Cast {
9595
if (typeof value === 'undefined' || typeof value === 'null') {
9696
return String();
9797
} else if (typeof value === 'object') {
98-
return JSON.stringify(value);
98+
try {
99+
return JSON.stringify(value);
100+
} catch {} // Fallthrough
99101
}
100102
return String(value);
101103
}

0 commit comments

Comments
 (0)