Fix crash in isNewer when latestVersion is empty; bump to 1.1.2-beta.4
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>1.1.2-beta.3</string>
|
<string>1.1.2-beta.4</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>35</string>
|
<string>35</string>
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
|
|||||||
@@ -319,6 +319,7 @@ class UpdateManager: ObservableObject {
|
|||||||
|
|
||||||
private func isNewer(_ version: String, than current: String) -> Bool {
|
private func isNewer(_ version: String, than current: String) -> Bool {
|
||||||
func parse(_ v: String) -> (base: [Int], pre: [Int]?) {
|
func parse(_ v: String) -> (base: [Int], pre: [Int]?) {
|
||||||
|
guard !v.isEmpty else { return ([], nil) }
|
||||||
let halves = v.split(separator: "-", maxSplits: 1)
|
let halves = v.split(separator: "-", maxSplits: 1)
|
||||||
let base = halves[0].split(separator: ".").compactMap { Int($0) }
|
let base = halves[0].split(separator: ".").compactMap { Int($0) }
|
||||||
let pre = halves.count > 1 ? String(halves[1]).split(separator: ".").compactMap { Int($0) } : nil
|
let pre = halves.count > 1 ? String(halves[1]).split(separator: ".").compactMap { Int($0) } : nil
|
||||||
|
|||||||
Reference in New Issue
Block a user