From a37b8114b9c510f413faef03e867b70df84b517b Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Tue, 29 Jan 2013 14:46:43 +0000 Subject: [PATCH] Bugfix: fixed a bug that caused an NPE exception which occured when IPO had no curves attached. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10232 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../scene/plugins/blender/modifiers/ModifierHelper.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ModifierHelper.java b/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ModifierHelper.java index e7cdcc2dc..4780efcd0 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ModifierHelper.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/modifiers/ModifierHelper.java @@ -184,8 +184,10 @@ public class ModifierHelper extends AbstractBlenderHelper { Structure actionStructure = pAction.fetchData(blenderContext.getInputStream()).get(0); IpoHelper ipoHelper = blenderContext.getHelper(IpoHelper.class); Ipo ipo = ipoHelper.fromAction(actionStructure, blenderContext); - result = new ObjectAnimationModifier(ipo, actionStructure.getName(), objectStructure.getOldMemoryAddress(), blenderContext); - blenderContext.addModifier(objectStructure.getOldMemoryAddress(), result); + if(ipo != null) {//ipo can be null if it has no curves applied, ommit such modifier then + result = new ObjectAnimationModifier(ipo, actionStructure.getName(), objectStructure.getOldMemoryAddress(), blenderContext); + blenderContext.addModifier(objectStructure.getOldMemoryAddress(), result); + } } } return result;