Made the app-states taking constructor more defensive

so that it can be called with null in various ways
without throwing NPEs.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9167 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
PSp..om 13 years ago
parent dac2de12c6
commit 72561e7a8b
  1. 5
      engine/src/core/com/jme3/app/SimpleApplication.java

@ -102,10 +102,15 @@ public abstract class SimpleApplication extends Application {
public SimpleApplication( AppState... initialStates ) { public SimpleApplication( AppState... initialStates ) {
super(); super();
if (initialStates != null) {
for (AppState a : initialStates) { for (AppState a : initialStates) {
if (a != null) {
stateManager.attach(a); stateManager.attach(a);
} }
} }
}
}
@Override @Override
public void start() { public void start() {

Loading…
Cancel
Save