From 2f248d15df7de96bff0cb0dd80e823b53b027304 Mon Sep 17 00:00:00 2001 From: David Bernard Date: Tue, 3 Jun 2014 22:45:48 +0200 Subject: [PATCH] SDK: fix NPE in JmeGeometry.propertyChange --- .../com/jme3/gde/core/sceneexplorer/nodes/JmeGeometry.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeGeometry.java b/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeGeometry.java index e55a84e5a..e2388e622 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeGeometry.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/sceneexplorer/nodes/JmeGeometry.java @@ -155,7 +155,9 @@ public class JmeGeometry extends JmeSpatial implements MaterialChangeListener { public void run() { try { - SceneExplorerTopComponent.findInstance().swapMaterialChangeListener(JmeGeometry.this, ((Material) before).getAssetName(), ((Material) after).getAssetName()); + String beforeName = (before == null)? null : ((Material) before).getAssetName(); + String afterName = (after == null)? null : ((Material) after).getAssetName(); + SceneExplorerTopComponent.findInstance().swapMaterialChangeListener(JmeGeometry.this, beforeName, afterName); } catch (Exception e) { Exceptions.printStackTrace(e); }