Skip to content

Commit

Permalink
fix: Add null conditional on find parent directory (#1556)
Browse files Browse the repository at this point in the history
Add operator to prevent null exception if no directory is found
  • Loading branch information
joshuaseither authored Aug 2, 2023
1 parent e448387 commit 51788a1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public string GetPreferenceDirectory(bool createIfNotExist)
var currentDirectory = this.LambdaRuntime.LambdaAssemblyDirectory;
while (currentDirectory != null && !Utils.IsProjectDirectory(currentDirectory))
{
currentDirectory = Directory.GetParent(currentDirectory).FullName;
currentDirectory = Directory.GetParent(currentDirectory)?.FullName;
}

if (currentDirectory == null)
Expand Down

0 comments on commit 51788a1

Please sign in to comment.