Address some nullability in tests

This commit is contained in:
Matt Nadareski
2024-03-05 13:32:49 -05:00
parent dd03d30547
commit 5ea131c7e1
11 changed files with 228 additions and 162 deletions

View File

@@ -29,8 +29,12 @@ namespace SabreTools.DatTools
/// <param name="filename">Name of the file to be parsed</param>
/// <param name="statsOnly">True to only add item statistics while parsing, false otherwise</param>
/// <param name="throwOnError">True if the error that is thrown should be thrown back to the caller, false otherwise</param>
public static DatFile CreateAndParse(string filename, bool statsOnly = false, bool throwOnError = false)
public static DatFile CreateAndParse(string? filename, bool statsOnly = false, bool throwOnError = false)
{
// Null filenames are invalid
if (filename == null)
return DatFile.Create();
DatFile datFile = DatFile.Create();
ParseInto(datFile, new ParentablePath(filename), statsOnly: statsOnly, throwOnError: throwOnError);
return datFile;