Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorSebastián Barschkis <sebbas@sebbas.org>2020-02-06 17:56:02 +0300
committerSebastián Barschkis <sebbas@sebbas.org>2020-02-06 17:56:34 +0300
commitb088d1e9969d440ffb7cc9614cef0ca81da46433 (patch)
tree09cfb09da4f58b965661a1d2a91d99d2bff5de95 /source
parent515b4d9a84c4f183030017cb7023e49917cd6353 (diff)
Particle: Added sanity in particle system removal function
Added a NULL check since psys_get_modifier() might also return a NULL pointer.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/particle.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 97fcef4fd27..eafd530b0d8 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3638,12 +3638,14 @@ void object_remove_particle_system(Main *bmain, Scene *UNUSED(scene), Object *ob
}
}
- /* clear modifier */
+ /* Clear modifier, skip empty ones. */
psmd = psys_get_modifier(ob, psys);
- BLI_remlink(&ob->modifiers, psmd);
- modifier_free((ModifierData *)psmd);
+ if (psmd) {
+ BLI_remlink(&ob->modifiers, psmd);
+ modifier_free((ModifierData *)psmd);
+ }
- /* clear particle system */
+ /* Clear particle system. */
BLI_remlink(&ob->particlesystem, psys);
if (psys->part) {
id_us_min(&psys->part->id);