Skip to content

Commit

Permalink
Merge pull request #925 from mikehazell/pr/fix-brush-tool-crashing
Browse files Browse the repository at this point in the history
fix(BaseBrushTool.js): prevents a crash in passiveCallback
  • Loading branch information
dannyrb authored May 7, 2019
2 parents 2969865 + 8b32801 commit 8480029
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tools/base/BaseBrushTool.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,13 @@ class BaseBrushTool extends BaseTool {
*/
// eslint-disable-next-line no-unused-vars
passiveCallback(evt) {
external.cornerstone.updateImage(this.element);
try {
external.cornerstone.updateImage(this.element);
} catch (error) {
// It is possible that the image has not been loaded
// when this is called.
return;
}
}

/**
Expand Down

0 comments on commit 8480029

Please sign in to comment.