Skip to content

Commit ebe4069

Browse files
committed
Remove the last \\ or / in path if it exists because it can cause path type checking issues
1 parent b183298 commit ebe4069

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Views/QuickAccessLinkSettings.xaml.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,14 @@ private void SelectPath_OnClick(object commandParameter, RoutedEventArgs e)
163163
CheckPathExists = true
164164
};
165165

166+
var path = openFileDialog.FileName;
166167
if (openFileDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK ||
167-
string.IsNullOrEmpty(openFileDialog.FileName))
168+
string.IsNullOrEmpty(path))
168169
return;
169170

170-
SelectedPath = openFileDialog.FileName;
171+
// Remove the last \\ or / in path if it exists because it can cause path type checking issues
172+
path = path.TrimEnd('\\', '/');
173+
SelectedPath = path;
171174
}
172175
else // Folder selection
173176
{
@@ -176,11 +179,14 @@ private void SelectPath_OnClick(object commandParameter, RoutedEventArgs e)
176179
ShowNewFolderButton = true
177180
};
178181

182+
var path = folderBrowserDialog.SelectedPath;
179183
if (folderBrowserDialog.ShowDialog() != System.Windows.Forms.DialogResult.OK ||
180-
string.IsNullOrEmpty(folderBrowserDialog.SelectedPath))
184+
string.IsNullOrEmpty(path))
181185
return;
182186

183-
SelectedPath = folderBrowserDialog.SelectedPath;
187+
// Remove the last \\ or / in path if it exists because it can cause path type checking issues
188+
path = path.TrimEnd('\\', '/');
189+
SelectedPath = path;
184190
}
185191
}
186192

0 commit comments

Comments
 (0)