fix: swallow update-image error for "clicking annotation arrows"; as doing _nothing_ if the image isn't loaded yet is perfectly okay (#2076)
This commit is contained in:
parent
0da451c26a
commit
4ae848761d
@ -27,6 +27,13 @@ export default function setMeasurementActive(measurement) {
|
||||
const enabledElements = cornerstoneTools.store.state.enabledElements;
|
||||
|
||||
enabledElements.forEach(element => {
|
||||
cornerstone.updateImage(element);
|
||||
try {
|
||||
cornerstone.updateImage(element);
|
||||
} catch (ex) {
|
||||
// https://github.com/cornerstonejs/cornerstone/blob/master/src/updateImage.js#L16
|
||||
// This fails if enabledElement.image is undefined and we have no layers
|
||||
// Instead of throwing, it should _probably_ do nothing.
|
||||
// We'll just swallow the exception
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user