[Bf-blender-cvs] [df7407e4515] modifier-panels-ui: Fix T75730: Crash on read of liboverride data when missing source modifier.

Bastien Montagne noreply at git.blender.org
Thu Apr 16 21:30:29 CEST 2020


Commit: df7407e45154fcbc553bf52ddc1f9f25d5c757d5
Author: Bastien Montagne
Date:   Wed Apr 15 17:23:56 2020 +0200
Branches: modifier-panels-ui
https://developer.blender.org/rBdf7407e45154fcbc553bf52ddc1f9f25d5c757d5

Fix T75730: Crash on read of liboverride data when missing source modifier.

While this should not happen, we still want to handle those errors
gracefully from user perspective (i.e. assert for devs, no crash for
users).

Actual fix of root cause of the issue will come later.

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

M	source/blender/makesrna/intern/rna_object.c

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

diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 6cdbda559c2..8cc7669ddce 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -1633,7 +1633,10 @@ bool rna_Object_modifiers_override_apply(Main *bmain,
   }
   mod_src = mod_src ? mod_src->next : ob_src->modifiers.first;
 
-  BLI_assert(mod_src != NULL);
+  if (mod_src == NULL) {
+    BLI_assert(mod_src != NULL);
+    return false;
+  }
 
   /* While it would be nicer to use lower-level modifier_new() here, this one is lacking
    * special-cases handling (particles and other physics modifiers mostly), so using the ED version



More information about the Bf-blender-cvs mailing list