Skip to content

Commit abd6cb5

Browse files
committed
AgendaList - fix other usages
1 parent 6a098e3 commit abd6cb5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/expandableCalendar/agendaList.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ const AgendaList = (props: AgendaListProps) => {
119119
const getNextSectionIndex = (date: string) => {
120120
let i = 0;
121121
for (let j = 1; j < sections.length; j++) {
122-
const prev = parseDate(sections[j - 1].title);
123-
const next = parseDate(sections[j].title);
122+
const prev = parseDate(sections[j - 1]?.title);
123+
const next = parseDate(sections[j]?.title);
124124
const cur = parseDate(date);
125125
if (isGTE(cur, prev) && isGTE(next, cur)) {
126126
i = sameDate(prev, cur) ? j - 1 : j;
@@ -164,7 +164,7 @@ const AgendaList = (props: AgendaListProps) => {
164164
}
165165
if (list?.current && sectionIndex !== undefined) {
166166
sectionScroll.current = true; // to avoid setDate() in onViewableItemsChanged
167-
_topSection.current = sections[sectionIndex].title;
167+
_topSection.current = sections[sectionIndex]?.title;
168168

169169
list?.current.scrollToLocation({
170170
animated: true,

0 commit comments

Comments
 (0)