Skip to content

Commit 0f8720e

Browse files
committed
fix: drawing measurement annotations throws errros when the MeasurementOverlay component is disabled
1 parent f6f4ab4 commit 0f8720e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/components/MeasurementOverlay/MeasurementOverlay.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ class MeasurementOverlay extends React.PureComponent {
107107
};
108108

109109
isMouseInsideRect = (e, overlayElement) => {
110+
if (overlayElement === null) {
111+
return false;
112+
}
113+
110114
const overlayRect = overlayElement.getBoundingClientRect();
111115
let x,y;
112116
if (e instanceof TouchEvent && e.touches) {

0 commit comments

Comments
 (0)