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:
2020-09-20 13:23:49 -05:00
parent 0d5aa352d3
commit e14894aad2

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;
}