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:
authorDalai Felinto <dfelinto@gmail.com>2018-02-06 18:17:43 +0300
committerDalai Felinto <dfelinto@gmail.com>2018-02-06 18:19:12 +0300
commit5633bab2d0384fcfc6a96313811fd3d6c8736c10 (patch)
treeb46b151ecfd9ad62fff91f67a34361757100e037 /source
parent1ae5dfd04933752c0cd5a11281806401fad0a1f2 (diff)
Fix crash when no active object
To reproduce the crash: delete the active object of the scene. This bug was introduced on e9c40b7339be9.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_info/info_stats.c7
1 files changed, 4 insertions, 3 deletions
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;
}