diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-04-03 05:19:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-04-03 05:43:03 +0300 |
commit | 09071e27993a6a113ea08376e361230d99e7690d (patch) | |
tree | 8e3ab373886a0e4baaa22986ca20d1fbce124c6d /source/blender/editors/armature/armature_select.c | |
parent | eae40c6c763c989f41210ff2972c1a024811133f (diff) |
Fix T75330: Select linked crashes without a bone near the cursor
Own error with recent improvements to select link.
Diffstat (limited to 'source/blender/editors/armature/armature_select.c')
-rw-r--r-- | source/blender/editors/armature/armature_select.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index 86396dd6783..cafaca1f967 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -290,6 +290,7 @@ void *get_nearest_bone(bContext *C, const int xy[2], bool findunsel, Base **r_ba bases, bases_len, vc.obedit != NULL, buffer, hits, findunsel, true, r_base); MEM_freeN(bases); + return bone; } return NULL; @@ -484,9 +485,13 @@ static int armature_select_linked_pick_invoke(bContext *C, wmOperator *op, const Base *base = NULL; EditBone *ebone_active = get_nearest_bone(C, event->mval, true, &base); - bArmature *arm = base->object->data; - if (ebone_active == NULL || !EBONE_SELECTABLE(arm, ebone_active)) { + if (ebone_active == NULL) { + return OPERATOR_CANCELLED; + } + + bArmature *arm = base->object->data; + if (!EBONE_SELECTABLE(arm, ebone_active)) { return OPERATOR_CANCELLED; } |