diff --git a/SabreTools.DatFiles/DatHeader.cs b/SabreTools.DatFiles/DatHeader.cs index 427a4060..302f623b 100644 --- a/SabreTools.DatFiles/DatHeader.cs +++ b/SabreTools.DatFiles/DatHeader.cs @@ -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, }; } diff --git a/SabreTools/Features/Sort.cs b/SabreTools/Features/Sort.cs index 0f2399bd..c7f676c4 100644 --- a/SabreTools/Features/Sort.cs +++ b/SabreTools/Features/Sort.cs @@ -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)) diff --git a/SabreTools/Features/Verify.cs b/SabreTools/Features/Verify.cs index 683b7ecb..bb2a3d5d 100644 --- a/SabreTools/Features/Verify.cs +++ b/SabreTools/Features/Verify.cs @@ -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))