diff --git a/src/common/libs/langDetector.ts b/src/common/libs/langDetector.ts index 265ba6e6..e300a73b 100644 --- a/src/common/libs/langDetector.ts +++ b/src/common/libs/langDetector.ts @@ -176,7 +176,7 @@ function isMD (str: string) { } export function langDetector (str: string) { - if (!str.trim().length) + if (!str || !str.trim().length) return 'text'; if (isJSON(str)) return 'json';