Skip to content

Commit eb3e391

Browse files
committed
fix nullref error for GetUnityExePath, fix Add Project folder checking, #build
1 parent a145853 commit eb3e391

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

UnityLauncherPro/MainWindow.xaml.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ void HandleCommandLineLaunch()
140140
commandLineArguments += " " + args[i];
141141
}
142142

143-
144143
var proj = new Project();
145144
proj.Version = version;
146145
proj.Path = projectPathArgument;
@@ -442,10 +441,16 @@ private void BtnAddProjectFolder_Click(object sender, RoutedEventArgs e)
442441
var folder = Tools.BrowseForOutputFolder("Select Project Folder to Add it Into Projects List");
443442
if (string.IsNullOrEmpty(folder) == false)
444443
{
444+
// create new project item
445445
var p = new Project();
446446
p.Path = folder;
447+
p.Title = Path.GetFileName(folder);
448+
p.Version = Tools.GetProjectVersion(folder);
449+
p.Arguments = Tools.ReadCustomLaunchArguments(folder, MainWindow.launcherArgumentsFile);
450+
// add to list
447451
projectsSource.Insert(0, p);
448452
gridRecent.Items.Refresh();
453+
gridRecent.SelectedIndex = 0;
449454
}
450455
}
451456

UnityLauncherPro/Tools.cs

+1
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ static bool CheckCrashBackupScene(string projectPath)
231231

232232
public static string GetUnityExePath(string version)
233233
{
234+
if (string.IsNullOrEmpty(version) == true) return null;
234235
return MainWindow.unityInstalledVersions.ContainsKey(version) ? MainWindow.unityInstalledVersions[version] : null;
235236
}
236237

0 commit comments

Comments
 (0)