fix null checks

experimental^2^2
Kirill Vainer 9 years ago
parent 21e63687cf
commit 14438e78e3
  1. 3
      jme3-core/src/main/java/com/jme3/scene/Spatial.java
  2. 2
      jme3-core/src/main/java/com/jme3/shader/Uniform.java

@ -603,6 +603,9 @@ public abstract class Spatial implements Savable, Cloneable, Collidable, Cloneab
* @see MatParamOverride * @see MatParamOverride
*/ */
public void addMatParamOverride(MatParamOverride override) { public void addMatParamOverride(MatParamOverride override) {
if (override == null) {
throw new IllegalArgumentException("override cannot be null");
}
localOverrides.add(override); localOverrides.add(override);
setMatParamOverrideRefresh(); setMatParamOverrideRefresh();
} }

@ -195,7 +195,7 @@ public class Uniform extends ShaderVariable {
} }
if (value == null) { if (value == null) {
throw new NullPointerException(); throw new IllegalArgumentException("for uniform " + name + ": value cannot be null");
} }
setByCurrentMaterial = true; setByCurrentMaterial = true;

Loading…
Cancel
Save