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:
Danny Brown authored and GitHub committed 2020-10-01 22:08:51 -04:00
1 parent 0da451c26a
commit 4ae848761d
1 file changed
+8 -1
@@ -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
}
});
}