From c3ddd72e06cdc29b850d62b7870ee4d52b3b22ac Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 12 Jan 2021 14:09:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/web/SourceDebugWebSocket.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/web/SourceDebugWebSocket.kt b/app/src/main/java/io/legado/app/web/SourceDebugWebSocket.kt index 8b18d1179..38d46fa6d 100644 --- a/app/src/main/java/io/legado/app/web/SourceDebugWebSocket.kt +++ b/app/src/main/java/io/legado/app/web/SourceDebugWebSocket.kt @@ -48,10 +48,8 @@ class SourceDebugWebSocket(handshakeRequest: NanoHTTPD.IHTTPSession) : val tag = debugBean["tag"] val key = debugBean["key"] if (tag.isNullOrBlank() || key.isNullOrBlank()) { - kotlin.runCatching { - send(App.INSTANCE.getString(R.string.cannot_empty)) - close(NanoWSD.WebSocketFrame.CloseCode.NormalClosure, "调试结束", false) - } + send(App.INSTANCE.getString(R.string.cannot_empty)) + close(NanoWSD.WebSocketFrame.CloseCode.NormalClosure, "调试结束", false) return } App.db.bookSourceDao.getBookSource(tag)?.let { @@ -75,6 +73,7 @@ class SourceDebugWebSocket(handshakeRequest: NanoHTTPD.IHTTPSession) : send(msg) if (state == -1 || state == 1000) { Debug.cancelDebug(true) + close(NanoWSD.WebSocketFrame.CloseCode.NormalClosure, "调试结束", false) } } }