diff --git a/engine/src/core/com/jme3/animation/AnimChannel.java b/engine/src/core/com/jme3/animation/AnimChannel.java index acad06e4c..e370ea9d2 100644 --- a/engine/src/core/com/jme3/animation/AnimChannel.java +++ b/engine/src/core/com/jme3/animation/AnimChannel.java @@ -344,10 +344,11 @@ public final class AnimChannel { time += tpf * speed; if (animation.getLength() > 0){ - if (time >= animation.getLength()) + if (time >= animation.getLength()) { control.notifyAnimCycleDone(this, animation.getName()); - else if (time < 0) + } else if (time < 0) { control.notifyAnimCycleDone(this, animation.getName()); + } } time = clampWrapTime(time, animation.getLength(), loopMode); diff --git a/engine/src/core/com/jme3/animation/BoneAnimation.java b/engine/src/core/com/jme3/animation/BoneAnimation.java index ac687e22f..2d08c687c 100644 --- a/engine/src/core/com/jme3/animation/BoneAnimation.java +++ b/engine/src/core/com/jme3/animation/BoneAnimation.java @@ -113,6 +113,9 @@ public final class BoneAnimation implements Animation, Savable, Cloneable { BitSet affectedBones = channel.getAffectedBones(); Skeleton skeleton = control.getSkeleton(); + if (tracks == null) + return; + for (int i = 0; i < tracks.length; i++) { if (affectedBones == null || affectedBones.get(tracks[i].getTargetBoneIndex())) { diff --git a/engine/src/desktop/com/jme3/asset/plugins/FileLocator.java b/engine/src/desktop/com/jme3/asset/plugins/FileLocator.java index 0456aec8c..be5aa1fb4 100644 --- a/engine/src/desktop/com/jme3/asset/plugins/FileLocator.java +++ b/engine/src/desktop/com/jme3/asset/plugins/FileLocator.java @@ -56,10 +56,15 @@ public class FileLocator implements AssetLocator { public void setRootPath(String rootPath) { if (rootPath == null) throw new NullPointerException(); - - root = new File(rootPath); - if (!root.isDirectory()) - throw new IllegalArgumentException("Given root path \"" + root + "\" not a directory"); + + try { + root = new File(rootPath).getCanonicalFile(); + if (!root.isDirectory()){ + throw new IllegalArgumentException("Given root path \"" + root + "\" not a directory"); + } + } catch (IOException ex) { + throw new AssetLoadException("Root path is invalid", ex); + } } private static class AssetInfoFile extends AssetInfo { @@ -76,7 +81,9 @@ public class FileLocator implements AssetLocator { try{ return new FileInputStream(file); }catch (FileNotFoundException ex){ - return null; + // NOTE: Can still happen even if file.exists() is true, e.g. + // permissions issue and similar + throw new AssetLoadException("Failed to open file: " + file, ex); } } } @@ -97,7 +104,6 @@ public class FileLocator implements AssetLocator { throw new AssetLoadException("Failed to get file canonical path " + file, ex); } - return new AssetInfoFile(manager, key, file); }else{ return null;