[Bf-blender-cvs] [36a7906] master: Fix T48980: crash when loading a file that contains a custom node tree.

Bastien Montagne noreply at git.blender.org
Sun Jul 31 20:08:49 CEST 2016


Commit: 36a790653c01809546ae2db9f9a56123f2dfdec7
Author: Bastien Montagne
Date:   Sun Jul 31 20:07:33 2016 +0200
Branches: master
https://developer.blender.org/rB36a790653c01809546ae2db9f9a56123f2dfdec7

Fix T48980: crash when loading a file that contains a custom node tree.

Syupid logical mistake in own recent rB018d336cbd51...

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

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

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f6d371e..7eabcd1 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) {




More information about the Bf-blender-cvs mailing list