Skip to content

Commit

Permalink
Catch another error
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Feb 28, 2024
1 parent ef58813 commit 0a91a0b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/NiivueMutator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,16 @@ class NiivueMutator {
try {
setter(value);
} catch (e) {
if (e instanceof Error && e.message === 'this.crosshairs3D is null') {
console.warn('Caught error which was fixed in https://github.com/niivue/niivue/pull/864, please update Niivue.');
if (!(e instanceof Error)) {
throw e;
}
if (
e.message === "this.crosshairs3D is null" ||
e.message === "Cannot read properties of null (reading 'mm')"
) {
console.warn(
"Caught error which was fixed in https://github.com/niivue/niivue/pull/864, please update Niivue.",
);
} else {
throw e;
}
Expand Down

0 comments on commit 0a91a0b

Please sign in to comment.