From f991cd362eb530ca8c9b4d6eff008b31b175995a Mon Sep 17 00:00:00 2001 From: Magicbook1108 Date: Mon, 23 Mar 2026 21:19:09 +0800 Subject: [PATCH] Fix: type check in resume parsing method (#13740) ### What problem does this PR solve? Fix: type check in resume parsing method ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- rag/app/resume.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rag/app/resume.py b/rag/app/resume.py index 08bb73776..80fc322bd 100644 --- a/rag/app/resume.py +++ b/rag/app/resume.py @@ -163,9 +163,11 @@ FIELD_MAP_EN = { } -def _is_english(lang: str) -> bool: - """Determine if the language parameter indicates English""" - return lang.lower() in ("english", "en") +def _is_english(lang: str | None) -> bool: + """Determine if the language parameter indicates English.""" + if not isinstance(lang, str): + return False + return lang.strip().lower() in ("english", "en") def get_field_map(lang: str) -> dict: