mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-21 14:25:03 +00:00
Check for "null" literal string cases
This commit is contained in:
@@ -685,11 +685,11 @@ namespace SabreTools.Metadata.DatFiles
|
||||
return rom;
|
||||
|
||||
// If the item has a SHA-1 but no size
|
||||
if (rom.Size is null && rom.SHA1 is not null)
|
||||
if (rom.Size is null && rom.SHA1 is not null && rom.SHA1 != "null")
|
||||
return rom;
|
||||
|
||||
// If the item has a SHA-256 but no size
|
||||
if (rom.Size is null && rom.SHA256 is not null)
|
||||
if (rom.Size is null && rom.SHA256 is not null && rom.SHA256 != "null")
|
||||
return rom;
|
||||
|
||||
// If the Rom has "null" characteristics, ensure all fields
|
||||
|
||||
@@ -88,7 +88,9 @@ namespace SabreTools.Metadata.DatFiles.Formats
|
||||
case Rom rom:
|
||||
if (string.IsNullOrEmpty(rom.Name))
|
||||
missingFields.Add(nameof(Data.Models.Metadata.Rom.Name));
|
||||
if ((rom.Size is null || rom.Size < 0) && rom.SHA1 is null && rom.SHA256 is null)
|
||||
if ((rom.Size is null || rom.Size < 0)
|
||||
&& (rom.SHA1 is null || rom.SHA1 == "null")
|
||||
&& (rom.SHA256 is null || rom.SHA1 == "null"))
|
||||
missingFields.Add(nameof(Data.Models.Metadata.Rom.Size));
|
||||
if (string.IsNullOrEmpty(rom.BLAKE3)
|
||||
&& string.IsNullOrEmpty(rom.CRC16)
|
||||
|
||||
@@ -282,7 +282,9 @@ namespace SabreTools.Metadata.DatFiles.Formats
|
||||
case Rom rom:
|
||||
if (string.IsNullOrEmpty(rom.Name))
|
||||
missingFields.Add(nameof(Data.Models.Metadata.Rom.Name));
|
||||
if ((rom.Size is null || rom.Size < 0) && rom.SHA1 is null && rom.SHA256 is null)
|
||||
if ((rom.Size is null || rom.Size < 0)
|
||||
&& (rom.SHA1 is null || rom.SHA1 == "null")
|
||||
&& (rom.SHA256 is null || rom.SHA1 == "null"))
|
||||
missingFields.Add(nameof(Data.Models.Metadata.Rom.Size));
|
||||
if (string.IsNullOrEmpty(rom.BLAKE3)
|
||||
&& string.IsNullOrEmpty(rom.CRC16)
|
||||
|
||||
@@ -93,7 +93,9 @@ namespace SabreTools.Metadata.DatFiles.Formats
|
||||
case Rom rom:
|
||||
if (string.IsNullOrEmpty(rom.Name))
|
||||
missingFields.Add(nameof(Data.Models.Metadata.Rom.Name));
|
||||
if ((rom.Size is null || rom.Size < 0) && rom.SHA1 is null && rom.SHA256 is null)
|
||||
if ((rom.Size is null || rom.Size < 0)
|
||||
&& (rom.SHA1 is null || rom.SHA1 == "null")
|
||||
&& (rom.SHA256 is null || rom.SHA1 == "null"))
|
||||
missingFields.Add(nameof(Data.Models.Metadata.Rom.Size));
|
||||
if (string.IsNullOrEmpty(rom.CRC32)
|
||||
&& string.IsNullOrEmpty(rom.MD5)
|
||||
|
||||
Reference in New Issue
Block a user