diff --git a/AltServer/Devices/ALTDeviceManager+Installation.swift b/AltServer/Devices/ALTDeviceManager+Installation.swift index 140293a1..4ec2b176 100644 --- a/AltServer/Devices/ALTDeviceManager+Installation.swift +++ b/AltServer/Devices/ALTDeviceManager+Installation.swift @@ -346,7 +346,8 @@ private extension ALTDeviceManager var isCancelled = false // Check if there is another AltStore certificate, which means AltStore has been installed with this Apple ID before. - if let previousCertificate = certificates.first(where: { $0.machineName?.starts(with: "AltStore") == true }) + let altstoreCertificate = certificates.first { $0.machineName?.starts(with: "AltStore") == true } + if let previousCertificate = altstoreCertificate { if FileManager.default.fileExists(atPath: certificateFileURL.path), let data = try? Data(contentsOf: certificateFileURL), @@ -419,7 +420,7 @@ private extension ALTDeviceManager } } - if let certificate = certificates.first + if let certificate = altstoreCertificate ?? certificates.first { if team.type != .free {