From 09db46c71eb8a610e2c6148e81a5642e99f9b72c Mon Sep 17 00:00:00 2001 From: jahorton Date: Mon, 20 Jun 2022 09:10:54 +0700 Subject: [PATCH] fix(ios): blocks Sentry event for known no-image case --- ios/keyman/Keyman/SWKeyboard/KeyboardViewController.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ios/keyman/Keyman/SWKeyboard/KeyboardViewController.swift b/ios/keyman/Keyman/SWKeyboard/KeyboardViewController.swift index 9b34e35445..5c99baac4a 100644 --- a/ios/keyman/Keyman/SWKeyboard/KeyboardViewController.swift +++ b/ios/keyman/Keyman/SWKeyboard/KeyboardViewController.swift @@ -61,6 +61,13 @@ class KeyboardViewController: InputViewController { } func setupTopBarImage(size: CGSize) { + // We override the height in getTopBarImage, but not width. + // If width is 0, we return null from that function; this'll + // trigger the guard below. + if size.width == 0 { + return + } + let imgPath = getTopBarImage(size: size) guard let path = imgPath else { SentryManager.captureAndLog("No image specified for the image banner!")