@@ -37,6 +37,7 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
3737 {
3838 if ( valueName . IndexOf ( "RecentlyUsedProjectPaths-" ) == 0 )
3939 {
40+ bool folderExists = false ;
4041 string projectPath = "" ;
4142 // check if binary or not
4243 var valueKind = key . GetValueKind ( valueName ) ;
@@ -51,7 +52,8 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
5152 }
5253
5354 // first check if whole folder exists, if not, skip
54- if ( showMissingFolders == false && Directory . Exists ( projectPath ) == false )
55+ folderExists = Directory . Exists ( projectPath ) ;
56+ if ( showMissingFolders == false && folderExists == false )
5557 {
5658 //Console.WriteLine("Recent project directory not found, skipping: " + projectPath);
5759 continue ;
@@ -76,48 +78,48 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
7678 string csprojFile = Path . Combine ( projectPath , projectName + ".csproj" ) ;
7779
7880 // solution only
79- if ( File . Exists ( csprojFile ) == false )
81+ if ( folderExists == true && File . Exists ( csprojFile ) == false )
8082 {
8183 csprojFile = Path . Combine ( projectPath , projectName + ".sln" ) ;
8284 }
8385
8486 // editor only project
85- if ( File . Exists ( csprojFile ) == false )
87+ if ( folderExists == true && File . Exists ( csprojFile ) == false )
8688 {
8789 csprojFile = Path . Combine ( projectPath , projectName + ".Editor.csproj" ) ;
8890 }
8991
9092 // maybe 4.x project, NOTE recent versions also have this as default
91- if ( File . Exists ( csprojFile ) == false )
93+ if ( folderExists == true && File . Exists ( csprojFile ) == false )
9294 {
9395 csprojFile = Path . Combine ( projectPath , "Assembly-CSharp.csproj" ) ;
9496 }
9597
9698 // get last modified date
97- DateTime ? lastUpdated = Tools . GetLastModifiedTime ( csprojFile ) ;
99+ DateTime ? lastUpdated = folderExists ? Tools . GetLastModifiedTime ( csprojFile ) : null ;
98100
99101 // get project version
100- string projectVersion = Tools . GetProjectVersion ( projectPath ) ;
102+ string projectVersion = folderExists ? Tools . GetProjectVersion ( projectPath ) : null ;
101103
102104 // get custom launch arguments, only if column in enabled
103105 string customArgs = "" ;
104106 if ( getArguments == true )
105107 {
106- customArgs = Tools . ReadCustomLaunchArguments ( projectPath , MainWindow . launcherArgumentsFile ) ;
108+ customArgs = folderExists ? Tools . ReadCustomLaunchArguments ( projectPath , MainWindow . launcherArgumentsFile ) : null ;
107109 }
108110
109111 // get git branchinfo, only if column in enabled
110112 string gitBranch = "" ;
111113 if ( getGitBranch == true )
112114 {
113- gitBranch = Tools . ReadGitBranchInfo ( projectPath ) ;
115+ gitBranch = folderExists ? Tools . ReadGitBranchInfo ( projectPath ) : null ;
114116 }
115117
116118 // TODO add option to disable check
117119 string targetPlatform = "" ;
118120 if ( showTargetPlatform == true )
119121 {
120- targetPlatform = Tools . ParseTargetPlatform ( projectPath ) ;
122+ targetPlatform = folderExists ? Tools . ParseTargetPlatform ( projectPath ) : null ;
121123 }
122124
123125 var p = new Project ( ) ;
@@ -128,6 +130,7 @@ public static List<Project> Scan(bool getGitBranch = false, bool getArguments =
128130 p . Arguments = customArgs ;
129131 p . GITBranch = gitBranch ;
130132 p . TargetPlatform = targetPlatform ;
133+ p . folderExists = folderExists ;
131134
132135 // if want to hide project and folder path for screenshot
133136 //p.Title = "Hidden Project";
0 commit comments