diff --git a/src/STranslate/ViewModels/Preference/OCR/WeChatOCR.cs b/src/STranslate/ViewModels/Preference/OCR/WeChatOCR.cs index 04e81bbc..11bdabc7 100644 --- a/src/STranslate/ViewModels/Preference/OCR/WeChatOCR.cs +++ b/src/STranslate/ViewModels/Preference/OCR/WeChatOCR.cs @@ -171,7 +171,11 @@ public async Task ExecuteAsync(byte[] bytes, LangEnum lang, Cancellat var ocrResult = new OcrResult(); var list = result?.OcrResult?.SingleResult; if (list == null) + { + //避免重复set tcs.SetResult(OcrResult.Fail("WeChatOCR get result is null")); + return; + } for (var i = 0; i < list?.Count; i++) {