diff --git a/src/components/pages/UserParentalControl.tsx b/src/components/pages/UserParentalControl.tsx index ce4fe71840..f4f9458641 100644 --- a/src/components/pages/UserParentalControl.tsx +++ b/src/components/pages/UserParentalControl.tsx @@ -145,7 +145,7 @@ const UserParentalControl: FunctionComponent = () => { for (const btnDelete of accessScheduleList.querySelectorAll('.btnDelete')) { btnDelete.addEventListener('click', function () { - const index = parseInt(btnDelete.getAttribute('data-index')); + const index = parseInt(btnDelete.getAttribute('data-index') || '0', 10); schedules.splice(index, 1); const newindex = schedules.filter(function (i: number) { return i != index;