Prevent trying to save null media tags, and report their presence to stderror.

This commit is contained in:
2019-08-10 14:35:14 +01:00
parent 298ac5969f
commit 44c96f1c04
5 changed files with 29 additions and 4 deletions

View File

@@ -1801,6 +1801,12 @@ namespace DiscImageChef.Core.Devices.Dumping
if(!aborted)
foreach(KeyValuePair<MediaTagType, byte[]> tag in mediaTags)
{
if(tag.Value is null)
{
DicConsole.ErrorWriteLine("Error: Tag type {0} is null, skipping...", tag.Key);
continue;
}
ret = outputPlugin.WriteMediaTag(tag.Value, tag.Key);
if(ret || force) continue;
@@ -1873,7 +1879,7 @@ namespace DiscImageChef.Core.Devices.Dumping
from partition in xmlTrack.FileSystemInformation
where partition.FileSystems != null
from fileSystem in partition.FileSystems
select ((ulong)partition.StartSector, fileSystem.Type));
select (partition.StartSector, fileSystem.Type));
if(filesystems.Count > 0)
foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct())