Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-05-25 04:31:41 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-05-25 04:31:41 +0400
commitb7653ba5421a245957ac6170f0bbca0589220bae (patch)
tree30d6115713ed0d422903f863426d521c550f5512 /source/blender/blenloader
parent48abe5a66efe886233c780dbffbe512f15a16720 (diff)
missing null check, would crash blender when loading some files
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d9df1ee4419..3284f8efdf2 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -8116,11 +8116,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
/* check if top parent has compound shape set and if yes, set this object
to compound shaper as well (was the behaviour before, now it's optional) */
Object *parent= newlibadr(fd, lib, ob->parent);
- while (parent->parent != NULL) {
- parent = newlibadr(fd, lib, parent->parent);
+ if(parent) {
+ while (parent->parent != NULL) {
+ parent = newlibadr(fd, lib, parent->parent);
+ }
+ if (parent->gameflag & OB_CHILD)
+ ob->gameflag |= OB_CHILD;
}
- if (parent->gameflag & OB_CHILD)
- ob->gameflag |= OB_CHILD;
}
}
for(wrld=main->world.first; wrld; wrld= wrld->id.next) {