Sometimes context.scene.sequence_editor can be None, this fix check for that and prevents python error.