From 071581ad30ff5d25318d06cf59bdff00c3805754 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Sun, 20 Jan 2013 18:49:48 +0000 Subject: [PATCH] Added clear information about bugged blender file. Rarely a pointer appears whose block cannot be found. This is cerainly a bug of blender and we cannot do anything but properly inform user about the situation. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10124 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../blender/com/jme3/scene/plugins/blender/file/Pointer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/file/Pointer.java b/engine/src/blender/com/jme3/scene/plugins/blender/file/Pointer.java index c3ad655a2..ec5c25cc2 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/file/Pointer.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/file/Pointer.java @@ -90,6 +90,10 @@ public class Pointer { } List structures = null; FileBlockHeader dataFileBlock = blenderContext.getFileBlock(oldMemoryAddress); + if(dataFileBlock == null) { + throw new BlenderFileException("No data stored for address: " +oldMemoryAddress + + ". Rarely blender makes mistakes when storing data. Try resaving the model after making minor changes. This usually helps."); + } if (pointerLevel > 1) { int pointersAmount = dataFileBlock.getSize() / inputStream.getPointerSize() * dataFileBlock.getCount(); for (int i = 0; i < pointersAmount; ++i) {