Skip to content

Commit

Permalink
Merge pull request #108 from ameaninglessname/release-fix-an-inifite-…
Browse files Browse the repository at this point in the history
…loop

fix infinite loop when clicked the diff button on the left right corn…
  • Loading branch information
mastercoms authored May 29, 2023
2 parents 64beb34 + 60a39b1 commit 7493986
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/GitSourceControl/Private/GitSourceControlUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ namespace GitSourceControlUtils
{
// Iterating over path directories, looking for .git
TestPath = FPaths::GetPath(TestPath);

if (TestPath.IsEmpty())
{
// early out if empty directory string to prevent infinite loop
UE_LOG(LogSourceControl, Error, TEXT("Can't find directory path for file :%s"), *FilePath);
break;
}

FString GitTestPath = TestPath + "/.git";
if (FPaths::FileExists(GitTestPath) || FPaths::DirectoryExists(GitTestPath))
{
Expand Down

0 comments on commit 7493986

Please sign in to comment.