From 171cbc34e21acee12099004ce207e1e1890e3060 Mon Sep 17 00:00:00 2001 From: sgschantz Date: Mon, 27 May 2024 16:10:33 +0700 Subject: [PATCH] fix(ios): prevent crash by removing incorrect cast in log statement when writing the fileUrl to the log, a variable was miscast causing the app to crash -- remove cast and return absoluteString for fileUrl Fixes #11567 --- .../Classes/Keyboard/KeymanWebViewController.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/engine/KMEI/KeymanEngine/Classes/Keyboard/KeymanWebViewController.swift b/ios/engine/KMEI/KeymanEngine/Classes/Keyboard/KeymanWebViewController.swift index 33f01912e3a..212f3e07342 100644 --- a/ios/engine/KMEI/KeymanEngine/Classes/Keyboard/KeymanWebViewController.swift +++ b/ios/engine/KMEI/KeymanEngine/Classes/Keyboard/KeymanWebViewController.swift @@ -314,7 +314,7 @@ extension KeymanWebViewController { event.extra?["package"] = packageID } SentryManager.capture(event) - os_log("%{public}s id: %s file: %{public}s", log: KeymanEngineLogger.resources, type: .error, errorMessage, keyboard.id, fileURL as CVarArg) + os_log("%{public}s id: %{public}s file: %{public}s", log: KeymanEngineLogger.resources, type: .error, errorMessage, keyboard.id, fileURL.absoluteString) throw KeyboardError.fileMissing } @@ -339,7 +339,7 @@ extension KeymanWebViewController { event.extra!["package"] = stub["KP"] SentryManager.capture(event) - os_log("%{public}s id: %{public}s file: %{public}s", log: KeymanEngineLogger.resources, type: .error, errorMessage, keyboard.id, fileURL as CVarArg) + os_log("%{public}s id: %{public}s file: %{public}s", log: KeymanEngineLogger.resources, type: .error, errorMessage, keyboard.id, fileURL.absoluteString) throw KeyboardError.keyboardLoadingError } guard let stubString = String(data: data, encoding: .utf8) else {