From 9eca2251a9e3889778b7a6194a15b7447368d96c Mon Sep 17 00:00:00 2001 From: Paul Speed Date: Sat, 20 Dec 2014 03:49:53 -0500 Subject: [PATCH] Handle more gracefully the case where a texture directive has no image specified. Prior to this it was throwing an ArrayIndexOutOfBounds exception which was silently swallowed even though the import fails. --- .../java/com/jme3/scene/plugins/ogre/MaterialLoader.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java index 03660ae74..36b67b04e 100644 --- a/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java +++ b/jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MaterialLoader.java @@ -159,6 +159,11 @@ public class MaterialLoader implements AssetLoader { String[] split = statement.getLine().split(" ", 2); String keyword = split[0]; if (keyword.equals("texture")){ + if (split.length < 2) { + logger.log(Level.WARNING, "Invalid texture directive, no image specified at [{0}]", + statement.getLineNumber()); + return; + } readTextureImage(split[1]); }else if (keyword.equals("tex_address_mode")){ String mode = split[1];