Skip to content

Commit af76bd9

Browse files
committed
fix: null ref is explore folder, without projects on the list (or filtered by search)
1 parent 1304310 commit af76bd9

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: UnityLauncherPro/MainWindow.xaml.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ Project GetSelectedProject()
657657
{
658658
return (Project)gridRecent.SelectedItem;
659659
}
660-
660+
661661
UnityInstallation GetSelectedUnity()
662662
{
663663
return (UnityInstallation)dataGridUnitys.SelectedItem;
@@ -1019,7 +1019,7 @@ private void BtnLaunchProject_Click(object sender, RoutedEventArgs e)
10191019
private void BtnExplore_Click(object sender, RoutedEventArgs e)
10201020
{
10211021
var proj = GetSelectedProject();
1022-
Tools.ExploreFolder(proj.Path);
1022+
Tools.ExploreFolder(proj?.Path);
10231023
Tools.SetFocusToGrid(gridRecent);
10241024
}
10251025

Diff for: UnityLauncherPro/Tools.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,10 @@ public static void AddProjectToHistory(string projectPath)
216216
// NOTE holding alt key (when using alt+o) brings up unity project selector
217217
public static Process LaunchProject(Project proj, DataGrid dataGridRef = null, bool useInitScript = false, bool upgrade = false)
218218
{
219-
Console.WriteLine("Launching project " + proj.Title + " at " + proj.Path);
220-
221219
if (proj == null) return null;
220+
221+
Console.WriteLine("Launching project " + proj?.Title + " at " + proj?.Path);
222+
222223
if (Directory.Exists(proj.Path) == false) return null;
223224

224225
// add this project to recent projects in preferences TODO only if enabled +40 projecs

0 commit comments

Comments
 (0)