From 3dcfcc65f3e1bf55703b3bcf6f9e72ae461f5bbe Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sat, 10 Aug 2024 13:15:26 +0200 Subject: [PATCH] Corrected order. --- src/magick-image-collection.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/magick-image-collection.ts b/src/magick-image-collection.ts index d5da33e2..c0e23a8f 100644 --- a/src/magick-image-collection.ts +++ b/src/magick-image-collection.ts @@ -622,6 +622,15 @@ export class MagickImageCollection extends Array implements IMagick } } + private checkResult(images: number, exception: Exception): number { + return exception.check(() => { + return images; + }, () => { + ImageMagick._api._MagickImageCollection_Dispose(images); + return 0; + }); + } + private static createObject(): MagickImageCollection { return Object.create(MagickImageCollection.prototype); } @@ -701,13 +710,4 @@ export class MagickImageCollection extends Array implements IMagick if (this.length === 0) throw new MagickError('operation requires at least one image'); } - - private checkResult(images: number, exception: Exception): number { - return exception.check(() => { - return images; - }, () => { - ImageMagick._api._MagickImageCollection_Dispose(images); - return 0; - }); - } }