Perform mass cleanup

This is cleanup based on both new .NET functionality (in 6 and 7) as well as a ton of simplifications and things that were missed that were caught due to the cleanup.
This commit is contained in:
Matt Nadareski
2023-04-19 16:39:58 -04:00
parent fd5fd79b95
commit 728b5d6b27
95 changed files with 1353 additions and 1572 deletions

View File

@@ -95,15 +95,23 @@ namespace SabreTools.Skippers
});
// Deserialize the detector, if possible
if (xts.Deserialize(xtr) is not Detector detector)
if (xts.Deserialize(xtr) is not Detector detector || detector == null)
continue;
// Set the source file
// Set the source file on the detector
string sourceFile = Path.GetFileNameWithoutExtension(skipperPath);
detector.SourceFile = sourceFile;
for (int i = 0; i < (detector.Rules?.Length ?? 0); i++)
// Set the source file on the rules
if (detector.Rules != null)
{
detector.Rules[i].SourceFile = sourceFile;
for (int i = 0; i < detector.Rules.Length; i++)
{
if (detector.Rules[i] == null)
continue;
detector.Rules[i].SourceFile = sourceFile;
}
}
// Add the skipper to the set