Fix crash in isNewer when latestVersion is empty; bump to 1.1.2-beta.4

This commit is contained in:
2026-05-07 22:56:12 +02:00
parent 12d7855ceb
commit 235ab81efb
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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>
+1
View File
@@ -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