OpenCut-app / OpenCut-app/OpenCut

[BUG] Unsafe getActive() calls crash editor when no project is loaded

Open
#723 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
89.8k
Forks
8.9k
PR merge metrics
No merged PRs in 30d

Description

Description

Multiple preview components call editor.project.getActive() and immediately access .settings without null checking. If no project is active, this throws and crashes the editor.

Affected Files

  • apps/web/src/components/editor/panels/preview/text-edit-overlay.tsx:72
  • apps/web/src/components/editor/panels/preview/transform-handles.tsx:102
  • apps/web/src/components/editor/panels/preview/toolbar.tsx:28
  • apps/web/src/components/editor/panels/preview/snap-guides.tsx:17
  • apps/web/src/components/editor/panels/preview/index.tsx:97-106, 192-194

Fix

Add null checks or use a safe getActiveOrNull() pattern before accessing settings.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the listed preview components, especially the getActive() calls at text-edit-overlay.tsx:72, transform-handles.tsx:102, toolbar.tsx:28, snap-guides.tsx:17, and index.tsx:97-106, 192-194. Verify the editor behavior when no project is loaded, then ensure those accesses handle the absent project without crashing and confirm the preview remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.