Fix new information being added as new rom

This commit is contained in:
Matt Nadareski
2016-03-27 22:15:57 -07:00
parent 33b12e7a8a
commit 7df373ba70

View File

@@ -315,7 +315,7 @@ JOIN checksums
if (merged)
{
// Check if the rom is a duplicate
RomData last = roms[roms.Count - 1];
RomData last = (roms.Count == 0 ? new RomData() : roms[roms.Count - 1]);
bool shouldcont = false;
if (temp.Type == "rom" && last.Type == "rom")
{
@@ -339,6 +339,7 @@ JOIN checksums
last.CRC = (last.CRC == "" && temp.CRC != "" ? temp.CRC : last.CRC);
last.MD5 = (last.MD5 == "" && temp.MD5 != "" ? temp.MD5 : last.MD5);
last.SHA1 = (last.SHA1 == "" && temp.SHA1 != "" ? temp.SHA1 : last.SHA1);
roms.RemoveAt(roms.Count - 1);
roms.Insert(roms.Count - 1, last);
continue;