Commit 4d22bca
Ensure childSpans is always initialized to prevent undefined access
Initialize childSpans to empty array for all spans when they're created in
transform-trace-data, before the tree walk. This ensures childSpans is always
defined as per the Span type definition (childSpans: Array<Span>).
Previously, childSpans was only populated during tree walk, which could leave
it undefined for spans not in the tree or in edge cases. This violated the
type contract and required defensive null checks in consuming code.
Also removed unnecessary null check in sanitizeOverFlowingChildren since
childSpans is now guaranteed to be defined.
This fixes the issue where childSpans could be undefined despite being typed
as a required array.
Co-authored-by: yurishkuro <3523016+yurishkuro@users.noreply.github.com>1 parent fa834f7 commit 4d22bca
File tree
2 files changed
+2
-1
lines changed- packages/jaeger-ui/src
- components/TracePage/CriticalPath/utils
- model
2 files changed
+2
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
0 commit comments