Skip to content

Commit

Permalink
fix: NullReferenceException during some debug sessions
Browse files Browse the repository at this point in the history
...and not include a bunch of other work-in-progress changes this time
  • Loading branch information
lulzsun committed Mar 18, 2024
1 parent df10a5f commit 7c3a2d4
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Classes/Utils/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,15 @@ public static string GetSolutionPath() {
while (directory != null && !directory.GetFiles("*.sln").Any()) {
directory = directory.Parent;
}
if (directory == null) {
if (directory != null) {
return directory.FullName;
}
try {
return Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName;
}
return directory.FullName;
catch (NullReferenceException) {
return Directory.GetCurrentDirectory();
}
}
#endif
public static void PlaySound(string fileName) {
Expand Down

0 comments on commit 7c3a2d4

Please sign in to comment.