From 70ed5aca8913dcbb7ab5933aaeee90d890206d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 14 Jul 2025 11:20:13 +0200 Subject: [PATCH] Fix #141828: Applying outdated PoseAssets crashes Blender Gracefully handle the situation where an F-Curve in the pose asset targets a bone that no longer exists. Pull Request: https://projects.blender.org/blender/blender/pulls/141880 --- source/blender/editors/armature/pose_lib_2.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/armature/pose_lib_2.cc b/source/blender/editors/armature/pose_lib_2.cc index a9bcbcb9ec8..ed5c44da7eb 100644 --- a/source/blender/editors/armature/pose_lib_2.cc +++ b/source/blender/editors/armature/pose_lib_2.cc @@ -144,7 +144,12 @@ static void poselib_keytag_pose(bContext *C, Scene *scene, PoseBlendData *pbd) blender::Set keyed_pose_bones; auto autokey_pose_bones = [&](FCurve * /* fcu */, const char *bone_name) { bPoseChannel *pchan = BKE_pose_channel_find_name(pose, bone_name); - BLI_assert(pchan != nullptr); + if (!pchan) { + /* This bone cannot be found any more. This is fine, this can happen + * when F-Curves for a bone are included in a pose asset, and later the + * bone itself was renamed or removed. */ + return; + } if (BKE_pose_backup_is_selection_relevant(pbd->pose_backup) && !PBONE_SELECTED(armature, pchan->bone)) {