Fix T79874: VSE - error clearing fades without animation data

Maniphest Tasks: T79874

Differential Revision: https://developer.blender.org/D8624
This commit is contained in:
Philipp Oeser 2020-08-19 12:33:23 +02:00
parent f18e537451
commit 833bc70399
Notes: blender-bot 2023-02-14 10:32:59 +01:00
Referenced by issue #79874, VSE - NoneType error with using clear fade without adding a fade before.
1 changed files with 7 additions and 1 deletions

View File

@ -151,7 +151,13 @@ class SequencerFadesClear(Operator):
return context.scene and context.scene.sequence_editor and context.scene.sequence_editor.active_strip
def execute(self, context):
fcurves = context.scene.animation_data.action.fcurves
animation_data = context.scene.animation_data
if animation_data is None:
return {'CANCELLED'}
action = animation_data.action
if action is None:
return {'CANCELLED'}
fcurves = action.fcurves
fcurve_map = {
curve.data_path: curve
for curve in fcurves