[Bf-blender-cvs] [5b857102fa6] blender2.8: Add NULL checks to ED_object_base_activate
Campbell Barton
noreply at git.blender.org
Thu Feb 22 07:07:26 CET 2018
Commit: 5b857102fa6d3e1f92530343448b142c9666e8d8
Author: Campbell Barton
Date: Thu Feb 22 17:09:25 2018 +1100
Branches: blender2.8
https://developer.blender.org/rB5b857102fa6d3e1f92530343448b142c9666e8d8
Add NULL checks to ED_object_base_activate
Passing a NULL active base is valid,
own changes to mode-switching didn't check for this case.
===================================================================
M source/blender/editors/object/object_select.c
===================================================================
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index 8a62438dc80..851a5d86d1b 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -141,13 +141,14 @@ void ED_object_base_activate(bContext *C, Base *base)
{
Scene *scene = CTX_data_scene(C);
+ Object *obact = base ? base->object : NULL;
/* We don't know the previous active object in update.
*
* Not correct because it's possible other work-spaces use these.
* although that's a corner case. */
if (workspace->object_mode & OB_MODE_EDIT) {
FOREACH_OBJECT(view_layer, ob) {
- if (ob != base->object) {
+ if (ob != obact) {
if (BKE_object_is_in_editmode(ob)) {
ED_object_editmode_exit_ex(NULL, workspace, scene, ob, EM_FREEDATA);
}
@@ -159,7 +160,7 @@ void ED_object_base_activate(bContext *C, Base *base)
EvaluationContext eval_ctx;
CTX_data_eval_ctx(C, &eval_ctx);
FOREACH_OBJECT(view_layer, ob) {
- if (ob != base->object) {
+ if (ob != obact) {
if (ob->sculpt) {
switch (ob->sculpt->mode_type) {
case OB_MODE_VERTEX_PAINT:
More information about the Bf-blender-cvs
mailing list