Return empty not null

This commit is contained in:
Matt Nadareski
2021-03-23 08:47:36 -07:00
parent b9cc5e9ada
commit c3e7f0b99f
3 changed files with 5 additions and 5 deletions

View File

@@ -64,7 +64,7 @@ namespace BurnOutSharp.Matching
{
// If no content matches are defined, we fail out
if (Matchers == null || !Matchers.Any())
return (false, null);
return (false, new List<int>());
// Initialize the position list
List<int> positions = new List<int>();
@@ -74,7 +74,7 @@ namespace BurnOutSharp.Matching
{
(bool match, int position) = contentMatch.Match(fileContent);
if (!match)
return (false, null);
return (false, new List<int>());
else
positions.Add(position);
}

View File

@@ -179,7 +179,7 @@ namespace BurnOutSharp.Matching
{
// If there's no mappings, we can't match
if (matchers == null || !matchers.Any())
return null;
return new List<string>();
// Initialize the list of matched protections
List<string> matchedProtections = new List<string>();

View File

@@ -63,7 +63,7 @@ namespace BurnOutSharp.Matching
{
// If no path matches are defined, we fail out
if (Matchers == null || !Matchers.Any())
return (false, null);
return (false, new List<string>());
// Initialize the value list
List<string> values = new List<string>();
@@ -73,7 +73,7 @@ namespace BurnOutSharp.Matching
{
(bool match, string value) = pathMatch.Match(stack);
if (!match)
return (false, null);
return (false, new List<string>());
else
values.Add(value);
}