Fix depot cloning issue

This commit is contained in:
Matt Nadareski
2021-02-17 16:43:01 -08:00
parent 721689d4e7
commit 1059fa85b6
3 changed files with 10 additions and 10 deletions

View File

@@ -563,8 +563,8 @@ namespace SabreTools.DatFiles
AddExtension = this.AddExtension,
RemoveExtension = this.RemoveExtension,
GameName = this.GameName,
InputDepot = this.InputDepot.Clone() as DepotInformation,
OutputDepot = this.OutputDepot.Clone() as DepotInformation,
InputDepot = this.InputDepot?.Clone() as DepotInformation,
OutputDepot = this.OutputDepot?.Clone() as DepotInformation,
};
}
@@ -613,8 +613,8 @@ namespace SabreTools.DatFiles
AddExtension = this.AddExtension,
RemoveExtension = this.RemoveExtension,
GameName = this.GameName,
InputDepot = this.InputDepot.Clone() as DepotInformation,
OutputDepot = this.OutputDepot.Clone() as DepotInformation,
InputDepot = this.InputDepot?.Clone() as DepotInformation,
OutputDepot = this.OutputDepot?.Clone() as DepotInformation,
};
}

View File

@@ -96,8 +96,8 @@ namespace SabreTools.Features
Parser.ParseInto(datdata, datfile, int.MaxValue, keep: true);
// Set depot information
datdata.Header.InputDepot = Header.InputDepot.Clone() as DepotInformation;
datdata.Header.OutputDepot = Header.OutputDepot.Clone() as DepotInformation;
datdata.Header.InputDepot = Header.InputDepot?.Clone() as DepotInformation;
datdata.Header.OutputDepot = Header.OutputDepot?.Clone() as DepotInformation;
// If we have overridden the header skipper, set it now
if (!string.IsNullOrEmpty(Header.HeaderSkipper))
@@ -135,8 +135,8 @@ namespace SabreTools.Features
}
// Set depot information
datdata.Header.InputDepot = Header.InputDepot.Clone() as DepotInformation;
datdata.Header.OutputDepot = Header.OutputDepot.Clone() as DepotInformation;
datdata.Header.InputDepot = Header.InputDepot?.Clone() as DepotInformation;
datdata.Header.OutputDepot = Header.OutputDepot?.Clone() as DepotInformation;
// If we have overridden the header skipper, set it now
if (!string.IsNullOrEmpty(Header.HeaderSkipper))

View File

@@ -71,7 +71,7 @@ namespace SabreTools.Features
Remover.ApplyRemovals(datdata);
// Set depot information
datdata.Header.InputDepot = Header.InputDepot.Clone() as DepotInformation;
datdata.Header.InputDepot = Header.InputDepot?.Clone() as DepotInformation;
// If we have overridden the header skipper, set it now
if (!string.IsNullOrEmpty(Header.HeaderSkipper))
@@ -119,7 +119,7 @@ namespace SabreTools.Features
Remover.ApplyRemovals(datdata);
// Set depot information
datdata.Header.InputDepot = Header.InputDepot.Clone() as DepotInformation;
datdata.Header.InputDepot = Header.InputDepot?.Clone() as DepotInformation;
// If we have overridden the header skipper, set it now
if (!string.IsNullOrEmpty(Header.HeaderSkipper))