Skip to content

Commit

Permalink
Fix weird error message
Browse files Browse the repository at this point in the history
When creating a new project, we now put up a "save as" dialog.  If
you cancel out of the dialog, and have auto-save enabled, we post a
strange message about being unable to create a file with an empty
filename string.
  • Loading branch information
fadden committed Aug 10, 2024
1 parent 69d3cd1 commit 5544014
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions SourceGen/MainController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -890,8 +890,13 @@ private void RefreshRecoveryFile() {
"' in favor of '" + pathName + "'");
DiscardRecoveryFile();
}
Debug.WriteLine("Recovery: creating '" + pathName + "'");
PrepareRecoveryFile();
if (!string.IsNullOrEmpty(pathName)) {
Debug.WriteLine("Recovery: creating '" + pathName + "'");
PrepareRecoveryFile();
} else {
// Must be a new project that has never been saved.
Debug.WriteLine("Recovery: project name not set, can't create recovery file");
}
}
mAutoSaveTimer.Start();
}
Expand All @@ -911,6 +916,7 @@ private static string GenerateRecoveryPathName(string pathName) {
/// </summary>
private void PrepareRecoveryFile() {
Debug.Assert(mRecoveryStream == null);
Debug.Assert(!string.IsNullOrEmpty(mProjectPathName));
Debug.Assert(string.IsNullOrEmpty(mRecoveryPathName));

string pathName = GenerateRecoveryPathName(mProjectPathName);
Expand Down

0 comments on commit 5544014

Please sign in to comment.