Browse Source

Fixed material exporting NPE when the additionalRenderState is null

Nehon 9 years ago
parent
commit
107123820b

+ 3 - 1
jme3-plugins/src/main/java/com/jme3/material/plugin/export/material/J3MRootOutputCapsule.java

@@ -91,7 +91,9 @@ public class J3MRootOutputCapsule extends J3MOutputCapsule {
 
     @Override
     public void write(Savable object, String name, Savable defVal) throws IOException {
-        object.write(exporter);
+        if(object != null && !object.equals(defVal)) {
+            object.write(exporter);
+        }
     }
 
 }