From 14438e78e33a3bd61494b88880206e8230eca3c1 Mon Sep 17 00:00:00 2001 From: Kirill Vainer Date: Tue, 8 Mar 2016 19:34:43 -0500 Subject: [PATCH] fix null checks --- jme3-core/src/main/java/com/jme3/scene/Spatial.java | 3 +++ jme3-core/src/main/java/com/jme3/shader/Uniform.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) 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;