Skip to content

Commit

Permalink
fix: ensure $inspect.trace works correctly with null values (#14853)
Browse files Browse the repository at this point in the history
* fix: ensure $inspect.trace works correctly with null values

* fix: ensure $inspect.trace works correctly with null values
  • Loading branch information
trueadm authored Dec 28, 2024
1 parent 7f8acb8 commit 32348a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rotten-ligers-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: ensure $inspect.trace works correctly with null values
4 changes: 3 additions & 1 deletion packages/svelte/src/internal/client/dev/tracing.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ function log_entry(signal, entry) {
status !== 'clean'
? 'color: CornflowerBlue; font-weight: bold'
: 'color: grey; font-weight: bold',
typeof value === 'object' && STATE_SYMBOL in value ? snapshot(value, true) : value
typeof value === 'object' && value !== null && STATE_SYMBOL in value
? snapshot(value, true)
: value
);

if (type === '$derived') {
Expand Down

0 comments on commit 32348a5

Please sign in to comment.