From 5ed0371456ca3b8421ddc1d350599afb26ec00eb Mon Sep 17 00:00:00 2001 From: hugo Date: Thu, 12 Feb 2026 15:35:20 +0100 Subject: [PATCH] fix: safety check for upload handler --- src/main/ipc/handlers.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/ipc/handlers.ts b/src/main/ipc/handlers.ts index de1cb8e..4b3083f 100644 --- a/src/main/ipc/handlers.ts +++ b/src/main/ipc/handlers.ts @@ -271,7 +271,16 @@ export function registerIpcHandlers(): void { return []; } + // Ensure project context is current before importing + const projectEngine = getProjectEngine(); + const project = await projectEngine.getActiveProject(); const engine = getMediaEngine(); + if (project) { + const internalDir = projectEngine.getInternalBaseDir(project.id); + const dataDir = projectEngine.getDataDir(project.id, project.dataPath); + engine.setProjectContext(project.id, dataDir, internalDir); + } + const imported: MediaData[] = []; for (const filePath of result.filePaths) {