diff --git a/orchestrator/src/server/api/routes.ts b/orchestrator/src/server/api/routes.ts index fb4dad0..d7de180 100644 --- a/orchestrator/src/server/api/routes.ts +++ b/orchestrator/src/server/api/routes.ts @@ -842,7 +842,11 @@ apiRouter.post('/manual-jobs/import', async (req: Request, res: Response) => { // Score asynchronously so the import returns immediately. (async () => { try { - const profile = (await loadResumeProfile()) as Record; + const rawProfile = await loadResumeProfile(); + if (!rawProfile || typeof rawProfile !== 'object' || Array.isArray(rawProfile)) { + throw new Error('Invalid resume profile format'); + } + const profile = rawProfile as Record; const { score, reason } = await scoreJobSuitability(createdJob, profile); await jobsRepo.updateJob(createdJob.id, { suitabilityScore: score,