Skip to content

Commit 32348a5

Browse files
authored
fix: ensure $inspect.trace works correctly with null values (#14853)
* fix: ensure $inspect.trace works correctly with null values * fix: ensure $inspect.trace works correctly with null values
1 parent 7f8acb8 commit 32348a5

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/rotten-ligers-agree.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: ensure $inspect.trace works correctly with null values

packages/svelte/src/internal/client/dev/tracing.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ function log_entry(signal, entry) {
5151
status !== 'clean'
5252
? 'color: CornflowerBlue; font-weight: bold'
5353
: 'color: grey; font-weight: bold',
54-
typeof value === 'object' && STATE_SYMBOL in value ? snapshot(value, true) : value
54+
typeof value === 'object' && value !== null && STATE_SYMBOL in value
55+
? snapshot(value, true)
56+
: value
5557
);
5658

5759
if (type === '$derived') {

0 commit comments

Comments
 (0)