APFS volumes don't necessarily have names (#490)
This commit is contained in:
parent
d47968d982
commit
f91b93bdb0
|
@ -32,7 +32,7 @@ impl CreateApfsVolume {
|
|||
plist::from_bytes(&output.stdout).map_err(Self::error)?;
|
||||
for container in parsed.containers {
|
||||
for volume in container.volumes {
|
||||
if volume.name == name {
|
||||
if volume.name.as_ref() == Some(&name) {
|
||||
return Ok(StatefulAction::completed(Self {
|
||||
disk: disk.as_ref().to_path_buf(),
|
||||
name,
|
||||
|
|
|
@ -83,7 +83,7 @@ impl EncryptApfsVolume {
|
|||
plist::from_bytes(&output.stdout).map_err(Self::error)?;
|
||||
for container in parsed.containers {
|
||||
for volume in container.volumes {
|
||||
if volume.name == name {
|
||||
if volume.name.as_ref() == Some(&name) {
|
||||
match volume.encryption == false {
|
||||
true => {
|
||||
return Ok(StatefulAction::completed(Self { disk, name }));
|
||||
|
|
|
@ -23,6 +23,6 @@ pub struct DiskUtilApfsContainer {
|
|||
#[derive(serde::Deserialize, Clone, Debug)]
|
||||
#[serde(rename_all = "PascalCase")]
|
||||
pub struct DiskUtilApfsListVolume {
|
||||
pub name: String,
|
||||
pub name: Option<String>,
|
||||
pub encryption: bool,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue