We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 750046c commit 2160aaaCopy full SHA for 2160aaa
packages/react-json-tree/src/JSONNestedNode.tsx
@@ -27,7 +27,7 @@ interface Entry {
27
}
28
29
function isRange(rangeOrEntry: Range | Entry): rangeOrEntry is Range {
30
- return (rangeOrEntry as Range).to !== undefined;
+ return (rangeOrEntry as Range)?.to !== undefined;
31
32
33
function renderChildNodes(
@@ -54,6 +54,10 @@ function renderChildNodes(
54
from,
55
to,
56
).forEach((entry) => {
57
+ // Don't process null/undefined entries, which can come from sparse arrays
58
+ if(!entry) {
59
+ return
60
+ }
61
if (isRange(entry)) {
62
childNodes.push(
63
<ItemRange
0 commit comments