Skip to content

Commit

Permalink
fix(ServiceSelectionPagination): check for undefined in options (#1080)
Browse files Browse the repository at this point in the history
  • Loading branch information
matyax authored Feb 17, 2025
1 parent 0e611da commit acc65e0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class ServiceSelectionPaginationScene extends SceneObjectBase<ServiceSele
const { countPerPage } = serviceSelectionScene.useState();
const options = getCountOptionsFromTotal(totalCount);
useEffect(() => {
const lastOptionValue = options[options.length - 1].value ?? countPerPage.toString();
const lastOptionValue = options[options.length - 1]?.value ?? countPerPage.toString();
if (countPerPage.toString() > lastOptionValue) {
serviceSelectionScene.setState({ countPerPage: parseInt(lastOptionValue, 10) });
}
Expand Down

0 comments on commit acc65e0

Please sign in to comment.