diff options
Diffstat (limited to 'apps/web/src/lib/commands/timeline/element')
| -rw-r--r-- | apps/web/src/lib/commands/timeline/element/insert-element.ts | 5 | ||||
| -rw-r--r-- | apps/web/src/lib/commands/timeline/element/keyframes/retime-keyframe.ts | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/apps/web/src/lib/commands/timeline/element/insert-element.ts b/apps/web/src/lib/commands/timeline/element/insert-element.ts index e1551471..68fc9841 100644 --- a/apps/web/src/lib/commands/timeline/element/insert-element.ts +++ b/apps/web/src/lib/commands/timeline/element/insert-element.ts @@ -173,6 +173,11 @@ export class InsertElementCommand extends Command { return false; } + if (element.type === "effect" && !element.effectType) { + console.error("Effect element must have effectType"); + return false; + } + return true; } diff --git a/apps/web/src/lib/commands/timeline/element/keyframes/retime-keyframe.ts b/apps/web/src/lib/commands/timeline/element/keyframes/retime-keyframe.ts index 29d95918..5328419f 100644 --- a/apps/web/src/lib/commands/timeline/element/keyframes/retime-keyframe.ts +++ b/apps/web/src/lib/commands/timeline/element/keyframes/retime-keyframe.ts @@ -49,6 +49,7 @@ export class RetimeKeyframeCommand extends Command { }), update: (element) => { const boundedTime = Math.max(0, Math.min(this.nextTime, element.duration)); + if (!Number.isFinite(boundedTime)) return element; return { ...element, animations: retimeElementKeyframe({ |
