From e2af210cf2a87f0a8ecfd25c9ed7c7558d2803af Mon Sep 17 00:00:00 2001 From: ColonelParrot <65585002+ColonelParrot@users.noreply.github.com> Date: Sat, 1 Feb 2025 21:01:53 -0500 Subject: [PATCH] port bugfix to node --- src/jscanify-node.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/jscanify-node.js b/src/jscanify-node.js index 3d7ec2d..6779fb1 100644 --- a/src/jscanify-node.js +++ b/src/jscanify-node.js @@ -80,7 +80,10 @@ class jscanify { } } - const maxContour = contours.get(maxContourIndex); + const maxContour = + maxContourIndex >= 0 ? + contours.get(maxContourIndex) : + null; imgGray.delete(); imgBlur.delete();