[Bf-blender-cvs] [42f7a29] fracture_modifier: small fix, need to check for context.object being possibly None

Martin Felke noreply at git.blender.org
Wed Dec 10 23:35:59 CET 2014


Commit: 42f7a29f57e3c0113b77921d692e18b89c03d7fd
Author: Martin Felke
Date:   Wed Dec 10 23:35:51 2014 +0100
Branches: fracture_modifier
https://developer.blender.org/rB42f7a29f57e3c0113b77921d692e18b89c03d7fd

small fix, need to check for context.object being possibly None

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

M	release/scripts/startup/bl_operators/presets.py

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

diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index bb068ee..bff5ec7 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -210,10 +210,11 @@ class ExecutePreset(Operator):
             #FRACTURE MODIFIER HACK, cant get bpy.context.fracture to be run via py script else...
             #so fake a context here
             mod = False
-            for md in context.object.modifiers:
-                if md.type == 'FRACTURE':
-                    mod = True
-                    break
+            if context.object is not None:
+                for md in context.object.modifiers:
+                    if md.type == 'FRACTURE':
+                        mod = True
+                        break
             if (mod):
                 ctx = bpy.context.copy()
                 ctx["fracture"] = md




More information about the Bf-blender-cvs mailing list