From f9b6587e31b5a5bf3737ef220886789f64f314ad Mon Sep 17 00:00:00 2001 From: kingbri Date: Wed, 24 Aug 2022 11:42:03 -0400 Subject: [PATCH] UIApplication: Make properties optional Don't want the application to crash because of a force unwrap. Signed-off-by: kingbri --- Ferrite/Extensions/UIApplication.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ferrite/Extensions/UIApplication.swift b/Ferrite/Extensions/UIApplication.swift index c4554ec..3490ab4 100644 --- a/Ferrite/Extensions/UIApplication.swift +++ b/Ferrite/Extensions/UIApplication.swift @@ -10,11 +10,11 @@ import SwiftUI // Extensions to get the version/build number for AboutView extension UIApplication { var appVersion: String { - Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String + Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "0.0.0" } var appBuild: String { - Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as! String + Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? "0" } var buildType: String {