Fix T75330: Select linked crashes without a bone near the cursor

Own error with recent improvements to select link.
This commit is contained in:
Campbell Barton 2020-04-03 13:19:26 +11:00
parent eae40c6c76
commit 09071e2799
Notes: blender-bot 2023-02-14 02:43:21 +01:00
Referenced by issue #75330, Bone Edit: Select Linked Crashes
1 changed files with 7 additions and 2 deletions

View File

@ -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;
}