Anim: Fix crash when getting animdata from non-Action editor
Check the space type before casting its data to `SpaceAction*`. Pull Request: https://projects.blender.org/blender/blender/pulls/127079
This commit is contained in:
@@ -71,7 +71,12 @@ AnimData *ED_actedit_animdata_from_context(const bContext *C, ID **r_adt_id_owne
|
||||
}
|
||||
}
|
||||
|
||||
SpaceAction *saction = (SpaceAction *)CTX_wm_space_data(C);
|
||||
SpaceLink *space_data = CTX_wm_space_data(C);
|
||||
if (!space_data || space_data->spacetype != SPACE_ACTION) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SpaceAction *saction = (SpaceAction *)space_data;
|
||||
if (!saction) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user