From 0923ccf41561e39ef6ccb7483d30988ca9243ecb Mon Sep 17 00:00:00 2001 From: "DESKTOP-3BO4HSG\\ksat" Date: Tue, 10 Jan 2023 11:22:53 +0800 Subject: [PATCH] fix: null input --- STranslate/ViewModel/MainVM.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/STranslate/ViewModel/MainVM.cs b/STranslate/ViewModel/MainVM.cs index 31c5e28..d9b351c 100644 --- a/STranslate/ViewModel/MainVM.cs +++ b/STranslate/ViewModel/MainVM.cs @@ -352,6 +352,7 @@ namespace STranslate.ViewModel { try { + if (string.IsNullOrEmpty(InputTxt.Trim())) throw new Exception("输入值为空!"); var isEng = string.Empty; IdentifyLanguage = string.Empty; OutputTxt = "翻译中...";