Skip to content

Commit 824885b

Browse files
committed
Merge branch 'fix/doublecrashonprojectsave' into refactors
2 parents fcbd118 + f9c8758 commit 824885b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/StudioCore/MapStudioNew.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ private bool StealGameDllIfMissing(ProjectSettings settings, string dllName)
630630

631631
public void SaveAll()
632632
{
633-
if (_projectSettings != null && _projectSettings.ProjectName != null)
633+
if (_projectSettings != null && _projectSettings.ProjectName != null && !string.IsNullOrWhiteSpace(CFG.Current.LastProjectFile))
634634
{
635635
// Danger zone assuming on lastProjectFile
636636
_projectSettings.Serialize(CFG.Current.LastProjectFile);
@@ -682,8 +682,10 @@ private void SaveFocusedEditor()
682682
{
683683
if (_projectSettings != null && _projectSettings.ProjectName != null)
684684
{
685-
// Danger zone assuming on lastProjectFile
686-
_projectSettings.Serialize(CFG.Current.LastProjectFile);
685+
if (!string.IsNullOrWhiteSpace(CFG.Current.LastProjectFile))
686+
{
687+
_projectSettings.Serialize(CFG.Current.LastProjectFile);
688+
}
687689
_focusedEditor.Save();
688690
}
689691
}

src/StudioCore/Project.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public Project CreateRecoveryProject()
108108
}
109109
catch (Exception e)
110110
{
111-
return this;
111+
return null;
112112
}
113113
}
114114
}

0 commit comments

Comments
 (0)