Commit: c0ac908fe864a6156a7307859f6b4744f532c927
Author: Mai Lavelle
Date:   Mon Apr 9 21:59:54 2018 -0400
Branches: blender2.8
https://developer.blender.org/rBc0ac908fe864a6156a7307859f6b4744f532c927

Fix crash when no object is active

Could happen when deleting the active object or opening an old file

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

M       release/scripts/startup/bl_ui/space_info.py
M       source/blender/editors/space_info/info_stats.c

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

diff --git a/release/scripts/startup/bl_ui/space_info.py 
b/release/scripts/startup/bl_ui/space_info.py
index 4bd7b3b1cb6..cbe6449d1df 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -48,8 +48,9 @@ class INFO_HT_header(Header):
             layout.template_ID(window, "workspace", 
new="workspace.workspace_add_menu", unlink="workspace.workspace_delete")
             layout.template_search_preview(window, "screen", workspace, 
"screens", new="screen.new", unlink="screen.delete", rows=2, cols=6)
 
-        act_mode_item = 
bpy.types.Object.bl_rna.properties["mode"].enum_items[layer.objects.active.mode]
-        layout.operator_menu_enum("object.mode_set", "mode", 
text=act_mode_item.name, icon=act_mode_item.icon)
+        if layer.objects.active:
+            act_mode_item = 
bpy.types.Object.bl_rna.properties["mode"].enum_items[layer.objects.active.mode]
+            layout.operator_menu_enum("object.mode_set", "mode", 
text=act_mode_item.name, icon=act_mode_item.icon)
 
         row = layout.row()
         row.active = not workspace.use_scene_settings
diff --git a/source/blender/editors/space_info/info_stats.c 
b/source/blender/editors/space_info/info_stats.c
index 157171481bc..c7d4fa1465b 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -389,7 +389,7 @@ static void stats_update(ViewLayer *view_layer)
                /* Pose Mode */
                stats_object_pose(ob, &stats);
        }
-       else if (stats_is_object_dynamic_topology_sculpt(ob, ob->mode)) {
+       else if (ob && stats_is_object_dynamic_topology_sculpt(ob, ob->mode)) {
                /* Dynamic-topology sculpt mode */
                stats_object_sculpt_dynamic_topology(ob, &stats);
        }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to