diff --git a/src/store/projectStore.ts b/src/store/projectStore.ts index 5ff94aa1..b70deb51 100644 --- a/src/store/projectStore.ts +++ b/src/store/projectStore.ts @@ -523,6 +523,17 @@ const projectStore = create()((set, get) => ({ //TODO: For now handle the question as unique identifier to avoid duplicate if (!projectId) projectId = 'Replay: ' + question; + if (!taskIds || taskIds.length === 0) { + console.warn('[ProjectStore] No taskIds provided for replayProject'); + return createProject( + `Replay Project ${question}`, + `No tasks to replay`, + projectId, + ProjectType.NORMAL, + historyId + ); + } + // If projectId is provided, reset that project if (projectId) { if (projects[projectId]) {