Skip to content

Commit

Permalink
Report out of memory exceptions (#144).
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemstra committed Feb 1, 2024
1 parent 7d07ab6 commit 4a212a6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/native-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ export abstract class NativeInstance {
/** @internal */
protected _setInstance(instance: number, exception: Exception): void {
exception.check(() => {
if (instance == 0)
throw new MagickError('out of memory');

this.dispose();
this.instance = instance;
}, () => {
Expand Down

0 comments on commit 4a212a6

Please sign in to comment.