This commit is contained in:
Roger Tuan 2025-03-06 16:25:39 +02:00 committed by GitHub
commit d582df2b71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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