Removed force unwrapping

This commit is contained in:
Stuart Breckenridge 2020-08-13 09:28:11 +08:00
parent 264cc6c87c
commit 13e28f6f3f
No known key found for this signature in database
GPG Key ID: 79BD673276AE83CE
1 changed files with 2 additions and 3 deletions

View File

@ -216,9 +216,8 @@ struct SettingsView: View {
} }
private func appVersion() -> String { private func appVersion() -> String {
let dict = NSDictionary(contentsOf: Bundle.main.url(forResource: "Info", withExtension: "plist")!) let version = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? ""
let version = dict?.object(forKey: "CFBundleShortVersionString") as? String ?? "" let build = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? ""
let build = dict?.object(forKey: "CFBundleVersion") as? String ?? ""
return "NetNewsWire \(version) (Build \(build))" return "NetNewsWire \(version) (Build \(build))"
} }