From fb3283f363342344375847b7f3f1ddb5f6eacbc2 Mon Sep 17 00:00:00 2001 From: StarryFolf Date: Wed, 12 Jul 2023 13:15:06 +0700 Subject: [PATCH] refactor logic --- src/Application/Entries/Commands/RestoreBinEntry.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Application/Entries/Commands/RestoreBinEntry.cs b/src/Application/Entries/Commands/RestoreBinEntry.cs index 832c121a..064d68d4 100644 --- a/src/Application/Entries/Commands/RestoreBinEntry.cs +++ b/src/Application/Entries/Commands/RestoreBinEntry.cs @@ -86,6 +86,11 @@ public async Task Handle(Command request, CancellationToken cancellati { continue; } + + if (currentPath.Equals("/") && node.Equals("")) + { + continue; + } var entrySearch = await _context.Entries.FirstOrDefaultAsync(x => x.Path.Equals(currentPath) && x.Name.Equals(node), cancellationToken);