[Bf-blender-cvs] [a494df8e383] master: Fix: Follow up to 16b795cb95c

Joshua Leung noreply at git.blender.org
Thu Apr 12 15:50:29 CEST 2018


Commit: a494df8e383d7dd0a4c5e192ed3e0be71984cb84
Author: Joshua Leung
Date:   Thu Apr 12 15:42:55 2018 +0200
Branches: master
https://developer.blender.org/rBa494df8e383d7dd0a4c5e192ed3e0be71984cb84

Fix: Follow up to 16b795cb95c

It's not just the Graph Editor that needed this - the NLA also uses similar code
and thus suffers from a similar problem.

(My first commit from the Blender Institute v2.0 - Just testing that everything works)

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

M	source/blender/editors/space_graph/space_graph.c
M	source/blender/editors/space_nla/space_nla.c

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

diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 530506e7c1d..362bd284105 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -682,12 +682,14 @@ static void graph_refresh(const bContext *C, ScrArea *sa)
 static void graph_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id)
 {
 	SpaceIpo *sgraph = (SpaceIpo *)slink;
-
-	if (sgraph->ads && (ID *)sgraph->ads->filter_grp == old_id) {
-		sgraph->ads->filter_grp = (Group *)new_id;
-	}
-	if (sgraph->ads && (ID *)sgraph->ads->source == old_id) {
-		sgraph->ads->source = new_id;
+	
+	if (sgraph->ads) {
+		if ((ID *)sgraph->ads->filter_grp == old_id) {
+			sgraph->ads->filter_grp = (Group *)new_id;
+		}
+		if ((ID *)sgraph->ads->source == old_id) {
+			sgraph->ads->source = new_id;
+		}
 	}
 }
 
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index 020b3a41f4d..f1e8b655673 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -505,12 +505,14 @@ static void nla_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn)
 static void nla_id_remap(ScrArea *UNUSED(sa), SpaceLink *slink, ID *old_id, ID *new_id)
 {
 	SpaceNla *snla = (SpaceNla *)slink;
-
-	if ((ID *)snla->ads->filter_grp == old_id) {
-		snla->ads->filter_grp = (Group *)new_id;
-	}
-	if ((ID *)snla->ads->source == old_id) {
-		snla->ads->source = new_id;
+	
+	if (snla->ads) {
+		if ((ID *)snla->ads->filter_grp == old_id) {
+			snla->ads->filter_grp = (Group *)new_id;
+		}
+		if ((ID *)snla->ads->source == old_id) {
+			snla->ads->source = new_id;
+		}
 	}
 }



More information about the Bf-blender-cvs mailing list