mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-29 23:12:38 +08:00
fix(translate): 处理未选择文件时提前返回以避免空指针异常
This commit is contained in:
parent
6c9202c5d5
commit
f74c63ff77
@ -439,6 +439,9 @@ const TranslatePage: FC = () => {
|
||||
setIsProcessing(true)
|
||||
try {
|
||||
const [file] = await onSelectFile({ multipleSelections: false })
|
||||
if (!file) {
|
||||
return
|
||||
}
|
||||
if (isSupportedOcrFile(file)) {
|
||||
window.message.loading({ content: t('ocr.processing'), key: 'translate_ocr_processing', duration: 0 })
|
||||
const ocrResult = await ocr(file)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user