From 3caafa325f8e0917372f9a3e0521238fc64bb94d Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 26 May 2020 21:47:47 +1000 Subject: [PATCH] Update getting previous directory method --- Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs index bac3c212b..a81ff8008 100644 --- a/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs +++ b/Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs @@ -164,16 +164,16 @@ namespace Flow.Launcher.Plugin.SharedCommands /// /// Gets the previous level directory from a path string. /// Checks that previous level directory exists and returns it - /// as a path string, or empty string if doesnt exit + /// as a path string, or empty string if doesn't exit /// public static string GetPreviousExistingDirectory(Func locationExists, string path) { var previousDirectoryPath = ""; - int index = path.LastIndexOf('\\'); + var index = path.LastIndexOf('\\'); if (index > 0 && index < (path.Length - 1)) { previousDirectoryPath = path.Substring(0, index + 1); - if (!locationExists(path)) + if (!locationExists(previousDirectoryPath)) { return ""; }