Fix #117620: Crash when moving bones to linked bone collection
`add_or_move_to_collection_bcoll()` already checked for linked collections, but the caller didn't properly do a `nullptr` check. Adding that check fixed the crash. The next commit will actually disable the menu for such collections, so that it's clear in the UI that it cannot work.
This commit is contained in:
@@ -929,6 +929,10 @@ static int add_or_move_to_collection_exec(bContext *C,
|
||||
|
||||
bArmature *arm = static_cast<bArmature *>(ob->data);
|
||||
BoneCollection *target_bcoll = add_or_move_to_collection_bcoll(op, arm);
|
||||
if (!target_bcoll) {
|
||||
/* add_or_move_to_collection_bcoll() already reported the reason. */
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
bool made_any_changes = false;
|
||||
bool had_bones_to_assign = false;
|
||||
|
||||
Reference in New Issue
Block a user