diff options
author | 2022-11-03 23:38:23 -0700 | |
---|---|---|
committer | 2022-11-03 23:38:23 -0700 | |
commit | 88ca7fd73854758f9019722d3d491e599af354e8 (patch) | |
tree | 531b856e5d620ae36284248cd376c2ddadad9890 | |
parent | 30e1fe1035b0e18c16401f447b446f2fc94c167b (diff) | |
download | bun-88ca7fd73854758f9019722d3d491e599af354e8.tar.gz bun-88ca7fd73854758f9019722d3d491e599af354e8.tar.zst bun-88ca7fd73854758f9019722d3d491e599af354e8.zip |
Fix crash in setTimeout/setInterval
-rw-r--r-- | src/bun.js/api/bun.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig index 6fb3f0b4a..e1e84c2d4 100644 --- a/src/bun.js/api/bun.zig +++ b/src/bun.js/api/bun.zig @@ -2307,6 +2307,11 @@ pub const Timer = struct { const result = callback.call(globalThis, &.{}); + if (result.isEmptyOrUndefinedOrNull() or !result.isCell()) { + this.deinit(); + return; + } + if (result.isAnyError(globalThis)) { vm.runErrorHandler(result, null); this.deinit(); |