diff options
author | Ton Roosendaal <ton@blender.org> | 2012-12-23 22:41:00 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2012-12-23 22:41:00 +0400 |
commit | 84eaa875def980c31a339f0ca7f62b6086b88ef4 (patch) | |
tree | 8c30b3d2d426238e47f85f725429230ea5af894c /source/blender/blenloader | |
parent | 90900495050a8a1060de94eaa533899c361ea80f (diff) |
Patch for weirdo library recursive linking errors:
In case you accidentally link data in a library file from the main file, Blender would crash.
Now it survives, giving error messages to tell what to fix.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 81101e01516..87eaab387a2 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8747,7 +8747,15 @@ static void expand_doit_library(void *fdhandle, Main *mainvar, void *old) Library *lib = read_struct(fd, bheadlib, "Library"); Main *ptr = blo_find_main(fd, lib->name, fd->relabase); - id = is_yet_read(fd, ptr, bhead); + if (ptr->curlib == NULL) { + const char *idname= bhead_id_name(fd, bhead); + + BKE_reportf_wrap(fd->reports, RPT_WARNING, TIP_("LIB ERROR: Data refers to main .blend file: '%s' from %s"), + idname, mainvar->curlib->filepath); + return; + } + else + id = is_yet_read(fd, ptr, bhead); if (id == NULL) { read_libblock(fd, ptr, bhead, LIB_READ+LIB_INDIRECT, NULL); |