Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite29680f

Browse files
committed
fix nullref for initscript folder#207
1 parentb9a37eb commite29680f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

‎UnityLauncherPro/MainWindow.xaml.cs‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,6 +2095,11 @@ void CreateNewEmptyProject(string targetFolder = null)
20952095
}
20962096
}
20972097

2098+
if(string.IsNullOrEmpty(initScriptFileFullPath)==true)
2099+
{
2100+
initScriptFileFullPath=Tools.GetSafeFilePath("Scripts","InitializeProject.cs");
2101+
}
2102+
20982103
// for new projects created from explorer, always ask for name
20992104
if(chkAskNameForQuickProject.IsChecked==true||targetFolder!=null)
21002105
{
@@ -3486,6 +3491,11 @@ private void btnExploreScriptsFolder_Click(object sender, RoutedEventArgs e)
34863491
{
34873492
if(Tools.LaunchExplorer(Path.GetDirectoryName(initScriptFileFullPath))==false)
34883493
{
3494+
if(string.IsNullOrEmpty(initScriptFileFullPath)==true)
3495+
{
3496+
initScriptFileFullPath=Tools.GetSafeFilePath("Scripts","InitializeProject.cs");
3497+
}
3498+
34893499
// if failed, open parent folder (probably path was using URL or no scripts yet)
34903500
varparentPath=Directory.GetParent(Path.GetDirectoryName(initScriptFileFullPath)).FullName;
34913501
if(Tools.LaunchExplorer(parentPath)==false)

‎UnityLauncherPro/Tools.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,8 @@ public static string GetUnityExePath(string version)
455455
// opens Explorer to target folder
456456
publicstaticboolLaunchExplorer(stringfolder)
457457
{
458+
if(folder==null||folder.Length<1)returnfalse;
459+
458460
if(Directory.Exists(folder)==true)
459461
{
460462
Process.Start(folder);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp