Skip to content

Commit

Permalink
fix(ios): prevent crash by removing incorrect cast in log statement
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sgschantz committed May 27, 2024
1 parent 79ac920 commit 171cbc3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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 {
Expand Down

0 comments on commit 171cbc3

Please sign in to comment.