Commit: 7b426d23845eb07befd3aeb0ec0e934dcabf643d
Author: Antony Riakiotakis
Date:   Fri Mar 6 14:22:00 2015 +0100
Branches: gooseberry
https://developer.blender.org/rB7b426d23845eb07befd3aeb0ec0e934dcabf643d

Fix issue reported on irc by Sebastian, crash when undoing and changing
screen.

Apparently the screen on the given file did not have a scene attached.

Not sure how this is possible exactly, but for now just guard against it
at load time by assigning default scene in that case.

===================================================================

M       source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index dcfffaf..0b78499 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -5846,6 +5846,12 @@ static void lib_link_screen(FileData *fd, Main *main)
                if (sc->id.flag & LIB_NEED_LINK) {
                        sc->id.us = 1;
                        sc->scene = newlibadr(fd, sc->id.lib, sc->scene);
+
+                       /* this should not happen, but apparently it does 
somehow. Until we figure out the cause,
+                        * just assign first available scene */
+                       if (!sc->scene)
+                               sc->scene = main->scene.first;
+
                        sc->animtimer = NULL; /* saved in rare cases */
                        
                        for (sa = sc->areabase.first; sa; sa = sa->next) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to