Enable nullability everywhere

This commit is contained in:
Matt Nadareski
2024-02-28 19:19:50 -05:00
parent 11d024bd16
commit 823a9ca7b7
145 changed files with 1545 additions and 1260 deletions

View File

@@ -25,14 +25,14 @@ namespace SabreTools.Reports.Formats
}
/// <inheritdoc/>
public override bool WriteToFile(string outfile, bool baddumpCol, bool nodumpCol, bool throwOnError = false)
public override bool WriteToFile(string? outfile, bool baddumpCol, bool nodumpCol, bool throwOnError = false)
{
InternalStopwatch watch = new($"Writing statistics to '{outfile}");
try
{
// Try to create the output file
Stream fs = _writeToConsole ? Console.OpenStandardOutput() : File.Create(outfile);
Stream fs = _writeToConsole ? Console.OpenStandardOutput() : File.Create(outfile ?? string.Empty);
if (fs == null)
{
logger.Warning($"File '{outfile}' could not be created for writing! Please check to see if the file is writable");
@@ -91,7 +91,7 @@ namespace SabreTools.Reports.Formats
{
string line = @"'" + stat.DisplayName + @"':
--------------------------------------------------
Uncompressed size: " + GetBytesReadable(stat.Statistics.TotalSize) + @"
Uncompressed size: " + GetBytesReadable(stat.Statistics!.TotalSize) + @"
Games found: " + stat.MachineCount + @"
Roms found: " + stat.Statistics.RomCount + @"
Disks found: " + stat.Statistics.DiskCount + @"