Skip to content

Commit 0461341

Browse files
committed
fix GeometryManager NPE
Initialize geometry manager before registering update observers that involve it, since the geometry manager's constructor can also trigger them, leading to an NPE due to the geometryManager field not being set a the time of the call. See #3. I hope it fixes it :)
1 parent eadf928 commit 0461341

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/edu/umich/soar/svsviewer/SceneController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public class SceneController {
7171

7272
@FXML
7373
public void initialize() {
74+
this.geometryManager =
75+
new GeometryManager(preferences, rootPane, shapeGroup, this::showMessage);
76+
7477
// TODO: would prefer to bind in the FXML file, but I couldn't get that to work.
7578
viewerScene.heightProperty().bind(rootPane.heightProperty());
7679
viewerScene.widthProperty().bind(rootPane.widthProperty());
@@ -174,9 +177,6 @@ public void initialize() {
174177

175178
rerenderSceneOnChange(rootGroup.boundsInParentProperty());
176179

177-
this.geometryManager =
178-
new GeometryManager(preferences, rootPane, shapeGroup, this::showMessage);
179-
180180
Consumer<String> inputProcessor =
181181
(String line) -> {
182182
List<String> tokens = Tokenizer.tokenizeCommand(line);

0 commit comments

Comments
 (0)