checked the page exclusion to not be out of bounds

This commit is contained in:
Valentin 2021-10-18 12:15:04 +03:00
parent 2949daf3ff
commit a8d5b7e5fb

View File

@ -49,7 +49,7 @@ export class PageExclusionComponent implements OnChanges {
const splitted = range.split('-');
const startPage = parseInt(splitted[0], 10);
const endPage = splitted.length > 1 ? parseInt(splitted[1], 10) : startPage;
if (!startPage || !endPage) {
if (!startPage || !endPage || startPage > this.file.numberOfPages || endPage > this.file.numberOfPages) {
throw new Error();
}
return {