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. 8
      jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderAWT.java

@ -143,7 +143,13 @@ public class TextureBlenderAWT extends AbstractTextureBlender {
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);
if (image.getMipMapSizes() != null) {
result.setMipMapSizes(image.getMipMapSizes().clone());

Loading…
Cancel
Save