]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Eliminated NullPointerException in vtkGizmo.deattachActors(). 47/4247/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Mon, 25 May 2020 10:06:52 +0000 (13:06 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 26 May 2020 08:00:26 +0000 (08:00 +0000)
gitlab #130

Change-Id: I6e4f4e526af083a99d87197fd2c9b90cf119b593
(cherry picked from commit d6a814242bf12a2dd247a4a817745a76dd079219)

org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/gizmo/vtkGizmo.java

index 47ee62b48bb5758a5d4ea857c8445b1a3c76c54b..2c70a68eefe8acf04ad14cb93345be927d3ff6be 100644 (file)
@@ -74,8 +74,10 @@ public abstract class vtkGizmo implements Gizmo<vtkProp, VtkView> {
        protected void deattachActors() {
                view.lock();
                vtkRenderer ren1 = view.getRenderer();
-               for (vtkProp p : gizmo) {
-                       ren1.RemoveActor(p);
+               if (ren1 != null) {
+                       for (vtkProp p : gizmo) {
+                               ren1.RemoveActor(p);
+                       }
                }
                view.unlock();
        }