Merge nucleic/mellow-dewy-falcon-rjhr into main
This commit is contained in:
@@ -155,12 +155,10 @@ public struct IPSWProvider: Sendable {
|
||||
// not a Swift error — when handed a non-file or missing path, and an
|
||||
// ObjC exception cannot be caught here. So the existence check is not
|
||||
// politeness; it is the only thing standing between a typo and a crash.
|
||||
var isDirectory: ObjCBool = false
|
||||
guard FileManager.default.fileExists(atPath: url.path, isDirectory: &isDirectory),
|
||||
!isDirectory.boolValue
|
||||
else {
|
||||
throw CoreError.notFound("restore image not found at \(url.path)")
|
||||
}
|
||||
// The size and magic-byte checks alongside it cover the other way this
|
||||
// call goes wrong: handed a partial download it neither fails nor
|
||||
// reports progress, it simply stops responding.
|
||||
try IPSWFile.validate(path: url.path)
|
||||
|
||||
do {
|
||||
return try await VZMacOSRestoreImage.image(from: url)
|
||||
|
||||
Reference in New Issue
Block a user