diff --git a/src/logic/DebugProfile.swift b/src/logic/DebugProfile.swift index 1df2f706..4d239694 100644 --- a/src/logic/DebugProfile.swift +++ b/src/logic/DebugProfile.swift @@ -107,9 +107,9 @@ class DebugProfile { static func inputSource() -> String { if let inputSource = TISCopyCurrentKeyboardInputSource()?.takeUnretainedValue(), - let cfName = TISGetInputSourceProperty(inputSource, kTISPropertyLocalizedName) { - let name = Unmanaged.fromOpaque(cfName).takeUnretainedValue() as String - return name + let localizedNamePointer = TISGetInputSourceProperty(inputSource, kTISPropertyLocalizedName) { + let localizedName = Unmanaged.fromOpaque(localizedNamePointer).takeUnretainedValue() + return localizedName as? String ?? "" } return "" }