OpenCut-app / OpenCut-app/OpenCut
[BUG] Unsafe getActive() calls crash editor when no project is loaded
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:72apps/web/src/components/editor/panels/preview/transform-handles.tsx:102apps/web/src/components/editor/panels/preview/toolbar.tsx:28apps/web/src/components/editor/panels/preview/snap-guides.tsx:17apps/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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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