Skip to content

Commit 7c3a2d4

Browse files
committed
fix: NullReferenceException during some debug sessions
...and not include a bunch of other work-in-progress changes this time
1 parent df10a5f commit 7c3a2d4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Classes/Utils/Helpers.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,15 @@ public static string GetSolutionPath() {
3838
while (directory != null && !directory.GetFiles("*.sln").Any()) {
3939
directory = directory.Parent;
4040
}
41-
if (directory == null) {
41+
if (directory != null) {
42+
return directory.FullName;
43+
}
44+
try {
4245
return Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName;
4346
}
44-
return directory.FullName;
47+
catch (NullReferenceException) {
48+
return Directory.GetCurrentDirectory();
49+
}
4550
}
4651
#endif
4752
public static void PlaySound(string fileName) {

0 commit comments

Comments
 (0)