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.
This commit is contained in:
Antonis Ryakiotakis 2015-03-06 14:22:00 +01:00
parent e95732bced
commit 1c3b2c58af
1 changed files with 6 additions and 0 deletions

View File

@ -5838,6 +5838,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) {