Skip to content

Commit

Permalink
Fix infinite While loop
Browse files Browse the repository at this point in the history
  • Loading branch information
BinToss committed Feb 14, 2021
1 parent 875040f commit f9e4a56
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions spv3/loader/src/Install.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,20 @@ public void ValidateTarget(string path)
try
{
var exists = Directory.Exists(path);
var rootExists = Directory.Exists(Path.GetPathRoot(path));
var root = Path.GetPathRoot(path);
var rootExists = Directory.Exists(root);

if (!exists && rootExists)
{
while (!Directory.Exists(path))
{
path = Directory.GetParent(path).Name;
if (path == CurrentDirectory) return;
path = Directory.GetParent(path).FullName;
if (path == CurrentDirectory)
{
Status = "Enter a valid path.";
CanInstall = false;
return;
}
}
}

Expand Down

0 comments on commit f9e4a56

Please sign in to comment.