diff --git a/Source/Modules/SessionCtl_HandleStates.swift b/Source/Modules/SessionCtl_HandleStates.swift index 2f977bb8..c0bf9eb3 100644 --- a/Source/Modules/SessionCtl_HandleStates.swift +++ b/Source/Modules/SessionCtl_HandleStates.swift @@ -121,18 +121,16 @@ public extension SessionCtl { /// 注意:必須在 IMK 的 commitComposition 函式當中也間接或者直接執行這個處理。 private func commit(text: String) { let text = text.trimmingCharacters(in: .newlines) - guard let client = client(), !text.isEmpty else { return } let buffer = ChineseConverter.kanjiConversionIfRequired(text) - if buffer.isEmpty { - return - } if isServingIMEItself { DispatchQueue.main.async { + guard let client = self.client() else { return } client.insertText( buffer, replacementRange: NSRange(location: NSNotFound, length: NSNotFound) ) } } else { + guard let client = client() else { return } client.insertText( buffer, replacementRange: NSRange(location: NSNotFound, length: NSNotFound) )