From b1595fe0bd5dc96d28a79bfbc4044000052fafbb Mon Sep 17 00:00:00 2001 From: intellism Date: Thu, 27 Jan 2022 19:11:09 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E5=89=AA=E8=B4=B4=E6=9D=BF=E7=A9=BA?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/command/select.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/command/select.ts b/client/src/command/select.ts index e67eb50..7b04fa5 100644 --- a/client/src/command/select.ts +++ b/client/src/command/select.ts @@ -6,6 +6,10 @@ import { lastHover } from "../languageFeature/hover"; export async function clipboard() { let text = await env.clipboard.readText(); + if(!text) { + outputChannel.appendLine('clipboard:The clipboard is empty'); + return; + } const targetLanguage = getConfig('targetLanguage') || userLanguage; let translatedText = await translateManager.translate(text, {to:targetLanguage}); outputChannel.appendLine('clipboard:' + translatedText);