mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-04-11 12:14:16 +03:00
Update JSONNestedNode.tsx to better handle sparse array inputs
This commit is contained in:
parent
750046c4d9
commit
2160aaa534
|
@ -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(
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user