From c3e7f0b99fd5e42f83f03db9749bd6c0803d9f10 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 23 Mar 2021 08:47:36 -0700 Subject: [PATCH] Return empty not null --- BurnOutSharp/Matching/ContentMatchSet.cs | 4 ++-- BurnOutSharp/Matching/MatchUtil.cs | 2 +- BurnOutSharp/Matching/PathMatchSet.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/BurnOutSharp/Matching/ContentMatchSet.cs b/BurnOutSharp/Matching/ContentMatchSet.cs index de756202..2735e56b 100644 --- a/BurnOutSharp/Matching/ContentMatchSet.cs +++ b/BurnOutSharp/Matching/ContentMatchSet.cs @@ -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()); // Initialize the position list List positions = new List(); @@ -74,7 +74,7 @@ namespace BurnOutSharp.Matching { (bool match, int position) = contentMatch.Match(fileContent); if (!match) - return (false, null); + return (false, new List()); else positions.Add(position); } diff --git a/BurnOutSharp/Matching/MatchUtil.cs b/BurnOutSharp/Matching/MatchUtil.cs index 6936c4aa..3fec7fdd 100644 --- a/BurnOutSharp/Matching/MatchUtil.cs +++ b/BurnOutSharp/Matching/MatchUtil.cs @@ -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(); // Initialize the list of matched protections List matchedProtections = new List(); diff --git a/BurnOutSharp/Matching/PathMatchSet.cs b/BurnOutSharp/Matching/PathMatchSet.cs index 57c8ae14..f89594ae 100644 --- a/BurnOutSharp/Matching/PathMatchSet.cs +++ b/BurnOutSharp/Matching/PathMatchSet.cs @@ -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()); // Initialize the value list List values = new List(); @@ -73,7 +73,7 @@ namespace BurnOutSharp.Matching { (bool match, string value) = pathMatch.Match(stack); if (!match) - return (false, null); + return (false, new List()); else values.Add(value); }