fix: sending feedback with a debug-profile could sometimes crash

This commit is contained in:
lwouis committed 2025-12-06 12:31:33 +01:00
1 parent db78e66451
commit e0ae29d64a
1 file changed
+3 -3
+3 -3
View File
@@ -107,9 +107,9 @@ class DebugProfile {
static func inputSource() -> String {
if let inputSource = TISCopyCurrentKeyboardInputSource()?.takeUnretainedValue(),
let cfName = TISGetInputSourceProperty(inputSource, kTISPropertyLocalizedName) {
let name = Unmanaged<CFString>.fromOpaque(cfName).takeUnretainedValue() as String
return name
let localizedNamePointer = TISGetInputSourceProperty(inputSource, kTISPropertyLocalizedName) {
let localizedName = Unmanaged<AnyObject>.fromOpaque(localizedNamePointer).takeUnretainedValue()
return localizedName as? String ?? ""
}
return ""
}