From 82c4e9cf41b0e6974db9b90129b303b36c4f7a05 Mon Sep 17 00:00:00 2001 From: Ludy Date: Sat, 9 Mar 2024 13:18:00 +0100 Subject: [PATCH] Fix TypeError by rotation (#890) Fixes the error in the PDF multitool when rotating all pages at the same time. --- src/main/resources/static/js/multitool/PdfContainer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/static/js/multitool/PdfContainer.js b/src/main/resources/static/js/multitool/PdfContainer.js index 76911a25..bb76d409 100644 --- a/src/main/resources/static/js/multitool/PdfContainer.js +++ b/src/main/resources/static/js/multitool/PdfContainer.js @@ -179,7 +179,9 @@ class PdfContainer { rotateAll(deg) { for (var i = 0; i < this.pagesContainer.childNodes.length; i++) { - const img = this.pagesContainer.childNodes[i].querySelector("img"); + const child = this.pagesContainer.children[i]; + if (!child) continue; + const img = child.querySelector("img"); if (!img) continue; this.rotateElement(img, deg); }