From 7c41355cca306abcc485090921376dd95bca3bed Mon Sep 17 00:00:00 2001 From: Nehon Date: Tue, 9 Dec 2014 00:00:08 +0100 Subject: [PATCH] fixed an issue where calling setCursorVisible on the ChaseCameraAppstate before it's initialized was causing an NPE. --- .../src/main/java/com/jme3/app/ChaseCameraAppState.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/app/ChaseCameraAppState.java b/jme3-core/src/main/java/com/jme3/app/ChaseCameraAppState.java index 9262f72f4..64eb6e5e7 100644 --- a/jme3-core/src/main/java/com/jme3/app/ChaseCameraAppState.java +++ b/jme3-core/src/main/java/com/jme3/app/ChaseCameraAppState.java @@ -127,6 +127,7 @@ public class ChaseCameraAppState extends AbstractAppState implements ActionListe initTogleRotateInput(); inputManager.addListener(this, inputs); + inputManager.setCursorVisible(dragToRotate); } public void onAction(String name, boolean keyPressed, float tpf) { @@ -429,7 +430,9 @@ public class ChaseCameraAppState extends AbstractAppState implements ActionListe public void setDragToRotate(boolean dragToRotate) { this.dragToRotate = dragToRotate; this.canRotate = !dragToRotate; - inputManager.setCursorVisible(dragToRotate); + if(inputManager != null){ + inputManager.setCursorVisible(dragToRotate); + } } /**