Skip to content

Commit 7d9880d

Browse files
committed
throw if spatial is not found
1 parent f85de8b commit 7d9880d

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

jme3-core/src/main/java/com/jme3/cinematic/Cinematic.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,12 @@ public void initialize(AppStateManager stateManager, Application app) {
329329
if (composer == null) {
330330
String ref = animEvent.getAnimRef();
331331
Spatial sp = findModelByRef(scene, ref);
332-
if (sp != null) {
333-
composer = sp.getControl(AnimComposer.class);
334-
animEvent.setComposer(composer);
332+
if (sp == null) {
333+
throw new IllegalStateException(
334+
"Cannot find model with ref id " + ref + " for AnimEvent");
335335
}
336+
composer = sp.getControl(AnimComposer.class);
337+
animEvent.setComposer(composer);
336338
}
337339
}
338340
cinematicEvent.initEvent(app, this);

0 commit comments

Comments
 (0)