[Bf-blender-cvs] [5633bab2d03] blender2.8: Fix crash when no active object

Dalai Felinto noreply at git.blender.org
Tue Feb 6 16:19:21 CET 2018


Commit: 5633bab2d0384fcfc6a96313811fd3d6c8736c10
Author: Dalai Felinto
Date:   Tue Feb 6 13:17:43 2018 -0200
Branches: blender2.8
https://developer.blender.org/rB5633bab2d0384fcfc6a96313811fd3d6c8736c10

Fix crash when no active object

To reproduce the crash: delete the active object of the scene.

This bug was introduced on e9c40b7339be9.

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

M	source/blender/editors/space_info/info_stats.c

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

diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c
index 4026ed8fcfe..25d590550ce 100644
--- a/source/blender/editors/space_info/info_stats.c
+++ b/source/blender/editors/space_info/info_stats.c
@@ -528,11 +528,12 @@ void ED_info_stats_clear(ViewLayer *view_layer)
 
 const char *ED_info_stats_string(Scene *scene, ViewLayer *view_layer)
 {
-	Object *ob = (view_layer->basact) ? view_layer->basact->object : NULL;
+	const eObjectMode object_mode = (view_layer->basact) ? view_layer->basact->object->mode : OB_MODE_OBJECT;
+
 	if (!view_layer->stats) {
-		stats_update(scene, view_layer, ob->mode);
+		stats_update(scene, view_layer, object_mode);
 	}
-	stats_string(scene, view_layer, ob->mode);
+	stats_string(scene, view_layer, object_mode);
 
 	return view_layer->stats->infostr;
 }



More information about the Bf-blender-cvs mailing list