diff --git a/Library/DiscUtils.Vmdk/DiskImageFile.cs b/Library/DiscUtils.Vmdk/DiskImageFile.cs index 1687f3613..e9cbdcbf4 100644 --- a/Library/DiscUtils.Vmdk/DiskImageFile.cs +++ b/Library/DiscUtils.Vmdk/DiskImageFile.cs @@ -145,6 +145,11 @@ internal DiskImageFile(FileLocator fileLocator, string file, FileAccess access) fileStream = fileLocator.Open(file, FileMode.Open, fileAccess, fileShare); LoadDescriptor(fileStream); + if (_descriptor is null) + { + throw new InvalidOperationException($"This VMDK image file does not contain an embedded descriptor"); + } + // For monolithic disks, keep hold of the stream - we won't try to use the file name // from the embedded descriptor because the file may have been renamed, making the // descriptor out of date.