diff --git a/jme3-core/src/main/java/com/jme3/scene/Spatial.java b/jme3-core/src/main/java/com/jme3/scene/Spatial.java index ce66275b4..f8600dfc8 100644 --- a/jme3-core/src/main/java/com/jme3/scene/Spatial.java +++ b/jme3-core/src/main/java/com/jme3/scene/Spatial.java @@ -603,6 +603,9 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab * @see MatParamOverride */ public void addMatParamOverride(MatParamOverride override) { + if (override == null) { + throw new IllegalArgumentException("override cannot be null"); + } localOverrides.add(override); setMatParamOverrideRefresh(); } diff --git a/jme3-core/src/main/java/com/jme3/shader/Uniform.java b/jme3-core/src/main/java/com/jme3/shader/Uniform.java index f167359ee..7ed468528 100644 --- a/jme3-core/src/main/java/com/jme3/shader/Uniform.java +++ b/jme3-core/src/main/java/com/jme3/shader/Uniform.java @@ -195,7 +195,7 @@ public class Uniform extends ShaderVariable { } if (value == null) { - throw new NullPointerException(); + throw new IllegalArgumentException("for uniform " + name + ": value cannot be null"); } setByCurrentMaterial = true;