fix: added check if the disk has valid UUID, if not - use disk BSDName instead (#2262)

This commit is contained in:
Serhiy Mytrovtsiy
2024-12-19 12:50:12 +01:00
parent d12e515a9c
commit 8fac9e4eb3

View File

@@ -328,6 +328,9 @@ private func driveDetails(_ disk: DADisk, removableState: Bool) -> drive? {
if d.path == nil {
return nil
}
if d.uuid == "" || d.uuid == "00000000-0000-0000-0000-000000000000" {
d.uuid = d.BSDName
}
let partitionLevel = d.BSDName.filter { "0"..."9" ~= $0 }.count
if let parent = getDeviceIOParent(DADiskCopyIOMedia(disk), level: Int(partitionLevel)) {