Skip to content

Commit cee27a9

Browse files
committed
Checking rectangles array is not empty before attempting to use it. MongoDB store adapter defines the arrays as empty when not specified.
1 parent 0ae3920 commit cee27a9

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

dist/pdf-annotate.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pdf-annotate.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pdf-annotate.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pdf-annotate.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/UI/edit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function handleDocumentMouseup(e) {
261261
}
262262

263263
t.setAttribute(attribY, viewY);
264-
if (annotation.rectangles) {
264+
if (annotation.rectangles && i < annotation.rectangles.length) {
265265
annotation.rectangles[i].y = modelY;
266266
} else if (annotation[attribY]) {
267267
annotation[attribY] = modelY;
@@ -276,7 +276,7 @@ function handleDocumentMouseup(e) {
276276
}
277277

278278
t.setAttribute(attribX, viewX);
279-
if (annotation.rectangles) {
279+
if (annotation.rectangles && i < annotation.rectangles.length) {
280280
annotation.rectangles[i].x = modelX;
281281
} else if (annotation[attribX]) {
282282
annotation[attribX] = modelX;

0 commit comments

Comments
 (0)