ctlIME // Stop clearInlineDisplay() from being crashed by nil.

This commit is contained in:
ShikiSuen 2022-08-12 10:39:40 +08:00
parent a227fa8459
commit 3d97dd9759
1 changed files with 2 additions and 1 deletions

View File

@ -103,7 +103,8 @@ extension ctlInputMethod {
/// .NotEmpty()
/// setInlineDisplayWithCursor()
private func clearInlineDisplay() {
client().setMarkedText(
guard let theClient = client() else { return }
theClient.setMarkedText(
"", selectionRange: NSRange(location: 0, length: 0),
replacementRange: NSRange(location: NSNotFound, length: NSNotFound)
)