From b76dacdea0adac0c9bb4d8409fa69bd91fbcd801 Mon Sep 17 00:00:00 2001 From: Huynh Quoc Dung Date: Mon, 17 Jan 2022 17:14:13 +0700 Subject: [PATCH] Fix crash when upgrade vtkjs to newer version --- src/VTKViewport/View2D.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/VTKViewport/View2D.js b/src/VTKViewport/View2D.js index 1b42660b..96cc5c1b 100644 --- a/src/VTKViewport/View2D.js +++ b/src/VTKViewport/View2D.js @@ -83,7 +83,9 @@ export default class View2D extends Component { const normal = camera.getDirectionOfProjection(); manip.setNormal(...normal); manip.setOrigin(...camera.getFocalPoint()); - handle.rotateFromDirections(handle.getDirection(), normal); + if (handle?.rotateFromDirections) { + handle.rotateFromDirections(handle.getDirection(), normal); + } } componentDidMount() {