From a494df8e383d7dd0a4c5e192ed3e0be71984cb84 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 12 Apr 2018 15:42:55 +0200 Subject: 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) --- source/blender/editors/space_graph/space_graph.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/space_graph/space_graph.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; + } } } -- cgit v1.2.3