Fix T80993: Crash duplicating inactive workspace

We need to check for the property editor's runtime struct
before duplicating it.
This commit is contained in:
Hans Goudey 2020-09-20 13:23:49 -05:00
parent 0d5aa352d3
commit e14894aad2
Notes: blender-bot 2023-10-04 09:42:55 +02:00
Referenced by issue #90455, Transparent Object intersecting shows artefacts in Render, but not in VP preview render
Referenced by issue #81033, Eevee Light Artifacts World Volume - Video
Referenced by issue #80993, duplicate workspace results in instant crash
1 changed files with 4 additions and 2 deletions

View File

@ -132,8 +132,10 @@ static SpaceLink *buttons_duplicate(SpaceLink *sl)
/* clear or remove stuff from old */
sbutsn->path = NULL;
sbutsn->texuser = NULL;
sbutsn->runtime = MEM_dupallocN(sfile_old->runtime);
sbutsn->runtime->search_string[0] = '\0';
if (sfile_old->runtime != NULL) {
sbutsn->runtime = MEM_dupallocN(sfile_old->runtime);
sbutsn->runtime->search_string[0] = '\0';
}
return (SpaceLink *)sbutsn;
}