Skip to content

Commit 04ca304

Browse files
Remove all instances where it can end in a directory seperator
1 parent 801daa8 commit 04ca304

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

ProtectionScan/Features/MainFeature.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,7 @@ private void WriteProtectionResultJson(string path, Dictionary<string, List<stri
336336
public static void InsertNode(Dictionary<string, object> nestedDictionary, string path, string[] protections, List<(Dictionary<string, object>, string, string[])> modifyNodeList)
337337
{
338338
var current = nestedDictionary;
339-
path = path.TrimStart(Path.DirectorySeparatorChar);
340-
var pathParts = path.Split(Path.DirectorySeparatorChar);
339+
var pathParts = path.Split(Path.DirectorySeparatorChar, StringSplitOptions.RemoveEmptyEntries);
341340

342341
// Traverses the nested dictionary until the "leaf" dictionary is reached.
343342
for (int i = 0; i < pathParts.Length - 1; i++)

0 commit comments

Comments
 (0)