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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-07-31 21:07:33 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-07-31 21:07:33 +0300
commit36a790653c01809546ae2db9f9a56123f2dfdec7 (patch)
treec9da0c9b8def9538f89479c513828f1a95e5fcaa /source/blender/blenloader
parentdda2d1dbea97079e725530fb070dd4ce053a7749 (diff)
Fix T48980: crash when loading a file that contains a custom node tree.
Syupid logical mistake in own recent rB018d336cbd51...
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f6d371ee2d3..7eabcd18fb8 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6338,10 +6338,8 @@ static void lib_link_screen(FileData *fd, Main *main)
snode->id = newlibadr(fd, sc->id.lib, snode->id);
snode->from = newlibadr(fd, sc->id.lib, snode->from);
- if (snode->id) {
- ntree = ntreeFromID(snode->id);
- snode->nodetree = ntree ? ntree : newlibadr_us(fd, sc->id.lib, snode->nodetree);
- }
+ ntree = snode->id ? ntreeFromID(snode->id) : NULL;
+ snode->nodetree = ntree ? ntree : newlibadr_us(fd, sc->id.lib, snode->nodetree);
for (path = snode->treepath.first; path; path = path->next) {
if (path == snode->treepath.first) {
@@ -6720,11 +6718,8 @@ void blo_lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *cursc
snode->id = restore_pointer_by_name(id_map, snode->id, USER_REAL);
snode->from = restore_pointer_by_name(id_map, snode->from, USER_IGNORE);
- if (snode->id) {
- ntree = ntreeFromID(snode->id);
- snode->nodetree = ntree ? ntree :
- restore_pointer_by_name(id_map, (ID *)snode->nodetree, USER_REAL);
- }
+ ntree = snode->id ? ntreeFromID(snode->id) : NULL;
+ snode->nodetree = ntree ? ntree : restore_pointer_by_name(id_map, (ID *)snode->nodetree, USER_REAL);
for (path = snode->treepath.first; path; path = path->next) {
if (path == snode->treepath.first) {