From: Reino Ruusu Date: Mon, 25 May 2020 10:06:52 +0000 (+0300) Subject: Eliminated NullPointerException in vtkGizmo.deattachActors(). X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F47%2F4247%2F1;p=simantics%2F3d.git Eliminated NullPointerException in vtkGizmo.deattachActors(). gitlab #130 Change-Id: I6e4f4e526af083a99d87197fd2c9b90cf119b593 (cherry picked from commit d6a814242bf12a2dd247a4a817745a76dd079219) --- diff --git a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/gizmo/vtkGizmo.java b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/gizmo/vtkGizmo.java index 47ee62b4..2c70a68e 100644 --- a/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/gizmo/vtkGizmo.java +++ b/org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/gizmo/vtkGizmo.java @@ -74,8 +74,10 @@ public abstract class vtkGizmo implements Gizmo { 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(); }