diff --git a/source/blender/editors/animation/anim_asset_ops.cc b/source/blender/editors/animation/anim_asset_ops.cc index 7c70666c462..5ba4d0e5dee 100644 --- a/source/blender/editors/animation/anim_asset_ops.cc +++ b/source/blender/editors/animation/anim_asset_ops.cc @@ -638,6 +638,9 @@ static wmOperatorStatus pose_asset_modify_exec(bContext *C, wmOperator *op) { bAction *action = get_action_of_selected_asset(C); BLI_assert_msg(action, "Poll should have checked action exists"); + /* Get asset now. Asset browser might get tagged for refreshing through operations below, and not + * allow querying items from context until refreshed, see #140781. */ + const asset_system::AssetRepresentation *asset = CTX_wm_asset(C); Main *bmain = CTX_data_main(C); Object *pose_object = CTX_data_active_object(C); @@ -655,7 +658,7 @@ static wmOperatorStatus pose_asset_modify_exec(bContext *C, wmOperator *op) bke::asset_edit_id_save(*bmain, action->id, *op->reports); } - asset::refresh_asset_library_from_asset(C, *CTX_wm_asset(C)); + asset::refresh_asset_library_from_asset(C, *asset); WM_main_add_notifier(NC_ASSET | ND_ASSET_LIST | NA_EDITED, nullptr); return OPERATOR_FINISHED;