fixes issue https://github.com/jMonkeyEngine/jmonkeyengine/issues/506 : Material->toString() does not prevent/check for possible NPEs

This commit is contained in:
jjYBdx4IL 2016-06-07 23:42:29 +02:00 committed by Rémy Bouquet
parent 95bf9efe9b
commit cfd491e270

View File

@ -994,8 +994,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) +
"]";
}