Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/react-json-tree/src/JSONNestedNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface Entry {
}

function isRange(rangeOrEntry: Range | Entry): rangeOrEntry is Range {
return (rangeOrEntry as Range).to !== undefined;
return (rangeOrEntry as Range)?.to !== undefined;
}

function renderChildNodes(
Expand All @@ -54,6 +54,10 @@ function renderChildNodes(
from,
to,
).forEach((entry) => {
// Don't process null/undefined entries, which can come from sparse arrays
if(!entry) {
return
}
if (isRange(entry)) {
childNodes.push(
<ItemRange
Expand Down