From a20a84cf42c578b26e442bc66e942d99028893cd Mon Sep 17 00:00:00 2001 From: jjYBdx4IL Date: Tue, 7 Jun 2016 23:42:29 +0200 Subject: [PATCH] fixes issue https://github.com/jMonkeyEngine/jmonkeyengine/issues/506 : Material->toString() does not prevent/check for possible NPEs --- jme3-core/src/main/java/com/jme3/material/Material.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/material/Material.java b/jme3-core/src/main/java/com/jme3/material/Material.java index d66f88a0b..74748f578 100644 --- a/jme3-core/src/main/java/com/jme3/material/Material.java +++ b/jme3-core/src/main/java/com/jme3/material/Material.java @@ -992,8 +992,8 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable { @Override public String toString() { return "Material[name=" + name + - ", def=" + def.getName() + - ", tech=" + technique.getDef().getName() + + ", def=" + (def != null ? def.getName() : null) + + ", tech=" + (technique != null && technique.getDef() != null ? technique.getDef().getName() : null) + "]"; }