Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix: validate JSON.parse result type before calling .replace() in prompts

lawrence3699ed7a3ad39441
diff --git a/src/config/prompts.ts b/src/config/prompts.ts
index 257da3341..7b6795ca1 100644
--- a/src/config/prompts.ts
+++ b/src/config/prompts.ts
@@ -106,7 +106,10 @@ export function getSystemPrompt(
const customPrompt = window.localStorage.getItem("customUnifiedPrompt");
if (customPrompt) {
try {
- promptTemplate = JSON.parse(customPrompt);
+ const parsed = JSON.parse(customPrompt);
+ if (typeof parsed === "string") {
+ promptTemplate = parsed;
+ }
} catch {}
}
}