Skip to content

Commit 2b7e281

Browse files
authored
Fix "TypeError: pages[offset] is undefined" (#1022)
This patch fixes the above error from the webconsole.
1 parent 69fa37d commit 2b7e281

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/thunks/tableThunks.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@ export const goToPage = (pageNumber: number) => async (dispatch: AppDispatch, ge
429429
const offset = getPageOffset(state);
430430
const pages = getTablePages(state);
431431

432-
dispatch(setPageActive(pages[offset].number));
432+
if (pages) {
433+
dispatch(setPageActive(offset ? pages[offset].number : pageNumber));
434+
}
433435

434436
// Get resources of page and load them into table
435437
// eslint-disable-next-line default-case

0 commit comments

Comments
 (0)