Skip to content

Commit 45e8791

Browse files
authored
Fix bug in disk extension compare path (#199)
* save * Fix bug in disk extension compare path
1 parent 327db57 commit 45e8791

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/VirtualClient/VirtualClient.Contracts/DiskExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@ public static bool PathEquals(this Disk disk, string path)
198198
bool volumeMatchDevicePath = false;
199199
bool volumeMatchAccessPath = false;
200200

201-
if (disk.Volumes.Any())
201+
if (disk.Volumes?.Any() == true)
202202
{
203203
volumeMatchDevicePath = disk.Volumes.Any(v => string.Equals(v.DevicePath.TrimEnd('/', '\\', ':'), path, StringComparison.OrdinalIgnoreCase));
204204
volumeMatchAccessPath = disk.Volumes.Any(v => v.AccessPaths.Any(ap => string.Equals(ap.TrimEnd('/', '\\', ':'), path, StringComparison.OrdinalIgnoreCase)));
205205
}
206206

207-
return matchDevicePath || volumeMatchAccessPath || volumeMatchAccessPath;
207+
return matchDevicePath || volumeMatchDevicePath || volumeMatchAccessPath;
208208
}
209209
}
210210
}

0 commit comments

Comments
 (0)