Skip to content

Commit 61fd8ef

Browse files
committed
Fix no uuid when using BIOS
1 parent a9f4137 commit 61fd8ef

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/read/get_partition/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,16 @@ fn parted_get_list_json_general() -> Vec<Disk>
6262
let model = is_available_string(parted["model"].to_string());
6363
let transport = is_available_string(parted["transport"].to_string());
6464
let label = is_available_string(parted["label"].to_string());
65-
let uuid = is_available_string(parted["uuid"].to_string());
65+
let uuid = is_available_string(
66+
if parted.contains_key("uuid")
67+
{
68+
parted["uuid"].to_string()
69+
}
70+
else
71+
{
72+
String::from("")
73+
}
74+
);
6675
let max_partition = parted["max-partitions"].to_string().trim().parse().unwrap();
6776

6877
let struct_disk = Disk::new(

0 commit comments

Comments
 (0)