Skip to content

Commit

Permalink
Fix crash when resolving broken paths
Browse files Browse the repository at this point in the history
  • Loading branch information
DSPaul committed Sep 18, 2024
1 parent 6c79745 commit c085dca
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/ViewModels/FileNotFoundViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ public void FindFile()
.ToList();
foreach (var c in codicesWithBrokenPaths)
{
string possiblePath = Path.Combine(replaceWith, c.Sources.Path[toReplace.Length..]);
if (File.Exists(possiblePath))
if (c.Sources.Path.StartsWith(toReplace))
{
c.Sources.Path = possiblePath;
fixedRefs++;
string possiblePath = Path.Combine(replaceWith, c.Sources.Path[toReplace.Length..]);
if (File.Exists(possiblePath))
{
c.Sources.Path = possiblePath;
fixedRefs++;
}
}
}

Expand Down

0 comments on commit c085dca

Please sign in to comment.