fix for NPE when being called from CombinedTexture with null baseImage (#1146)

* fix for NPE when being called from CombinedTexture with null baseImage

* formating only
accellbaker
empirephoenix 6 years ago committed by Stephen Gold
parent de092b92bb
commit 80aed88f82
  1. 10
      jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderAWT.java

@ -142,8 +142,14 @@ public class TextureBlenderAWT extends AbstractTextureBlender {
} }
dataArray.add(newData); dataArray.add(newData);
} }
ColorSpace colorSpace = baseImage.getColorSpace() != null ? baseImage.getColorSpace() : ColorSpace.Linear; ColorSpace colorSpace;
if (baseImage != null) {
colorSpace = baseImage.getColorSpace() != null ? baseImage.getColorSpace() : ColorSpace.Linear;
} else {
colorSpace = image.getColorSpace();
}
Image result = depth > 1 ? new Image(Format.RGBA8, width, height, depth, dataArray, colorSpace) : new Image(Format.RGBA8, width, height, dataArray.get(0), colorSpace); Image result = depth > 1 ? new Image(Format.RGBA8, width, height, depth, dataArray, colorSpace) : new Image(Format.RGBA8, width, height, dataArray.get(0), colorSpace);
if (image.getMipMapSizes() != null) { if (image.getMipMapSizes() != null) {
result.setMipMapSizes(image.getMipMapSizes().clone()); result.setMipMapSizes(image.getMipMapSizes().clone());

Loading…
Cancel
Save