Skip to content

Commit 9e4f46c

Browse files
authored
Merge pull request #8469 from woocommerce/issue/8467-about-screen-crash
2 parents 987cc90 + 6c5f297 commit 9e4f46c

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

WooCommerce/Classes/Extensions/UIImage+Woo.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ extension UIImage {
3737
return UIImage(named: "icon-analytics")!
3838
}
3939

40+
/// App icon (iPhone size)
41+
///
42+
static var appIconDefault: UIImage {
43+
return UIImage(named: "AppIcon60x60")!
44+
}
45+
4046
/// Currency Image
4147
///
4248
static var currencyImage: UIImage {

WooCommerce/Classes/ViewRelated/Dashboard/Settings/About/WooAboutScreenConfiguration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ final class WooAboutScreenConfiguration: AboutScreenConfiguration {
6969
static var appInfo: AboutScreenAppInfo {
7070
return AboutScreenAppInfo(name: WooConstants.appDisplayName,
7171
version: Bundle.main.detailedVersionNumber(),
72-
icon: UIImage(named: iconNameFromBundle())!)
72+
icon: UIImage(named: iconNameFromBundle()) ?? .appIconDefault)
7373
}
7474

7575
/// Provides font definitions for use in the header of the about screen.

WooCommerce/WooCommerceTests/Extensions/IconsTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,4 +720,8 @@ final class IconsTests: XCTestCase {
720720
func test_calendar_icon_is_not_nil() {
721721
XCTAssertNotNil(UIImage.calendar)
722722
}
723+
724+
func test_app_icon_is_not_nil() {
725+
XCTAssertNotNil(UIImage.appIconDefault)
726+
}
723727
}

0 commit comments

Comments
 (0)