From 7d28c52c3517b29b69dd5a96d0285ab9d514b130 Mon Sep 17 00:00:00 2001 From: ShellWen Chen Date: Sun, 21 Jul 2024 10:21:48 +0800 Subject: [PATCH] fix: now call `stop()` of sftp server will do nothing when sshd hasn't been initialized --- src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.kt b/src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.kt index 4b558fd7..8827f36c 100644 --- a/src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.kt +++ b/src/org/kde/kdeconnect/Plugins/SftpPlugin/SimpleSftpServer.kt @@ -147,6 +147,8 @@ internal class SimpleSftpServer { } fun stop() { + if (!::sshd.isInitialized) return + try { sshd.stop(true) } catch (e: Exception) {