Skip to content

Commit 158918a

Browse files
authored
Bug fixes for handling network path (#1091)
1 parent 1695dcf commit 158918a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Files/View Models/ItemViewModel.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,12 @@ private void WorkingDirectoryChanged()
305305

306306
// If path is found to not be a library
307307
pathComponents = WorkingDirectory.Split("\\", StringSplitOptions.RemoveEmptyEntries).ToList();
308+
308309
int index = 0;
310+
string tag = "";
309311
foreach (string s in pathComponents)
310312
{
311313
string componentLabel = null;
312-
string tag = "";
313314
if (s.StartsWith(App.AppSettings.RecycleBinPath))
314315
{
315316
// Handle the recycle bin: use the localized folder name
@@ -342,7 +343,7 @@ private void WorkingDirectoryChanged()
342343
else
343344
{
344345
componentLabel = s;
345-
foreach (string part in pathComponents.GetRange(0, index + 1))
346+
foreach (string part in pathComponents.GetRange(index, 1))
346347
{
347348
tag = tag + part + @"\";
348349
}

Files/Views/InstanceTabsView.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,10 @@ public async void SetSelectedTabInfo(string text, string currentPathForTabIcon =
342342

343343
public static string NormalizePath(string path)
344344
{
345+
if (string.IsNullOrEmpty(path))
346+
{
347+
return path;
348+
}
345349
if (path.StartsWith("\\\\"))
346350
{
347351
return path.TrimEnd(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar).ToUpperInvariant();

0 commit comments

Comments
 (0)