From 7d6ea02b9087825bf93d41983f966082b340e5c4 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Sat, 22 Feb 2014 17:51:45 +0000 Subject: [PATCH] Bugfix: fixed an issue that could cause NPE when lamp that is not supported in JME ('Hemi' light for example) had children nodes attached. git-svn-id: https://jmonkeyengine.googlecode.com/svn/branches/gradle-restructure@11062 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/scene/plugins/blender/objects/ObjectHelper.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/objects/ObjectHelper.java b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/objects/ObjectHelper.java index 5130e7148..b8d63db02 100644 --- a/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/objects/ObjectHelper.java +++ b/jme3-blender/src/main/java/com/jme3/scene/plugins/blender/objects/ObjectHelper.java @@ -190,6 +190,10 @@ public class ObjectHelper extends AbstractBlenderHelper { LightHelper lightHelper = blenderContext.getHelper(LightHelper.class); List lampsArray = pLamp.fetchData(); result = lightHelper.toLight(lampsArray.get(0), blenderContext); + if(result == null) { + //probably some light type is not supported, just create a node so that we can maintain child-parent relationship for nodes + result = new Node(name); + } } break; case CAMERA: