Fixed bug with password corrupt while creating new file

This commit is contained in:
Alexander 2019-10-26 00:12:19 +03:00
parent a2a7d0db68
commit e130e5d90f

View file

@ -990,18 +990,18 @@ private void NewMainMenu_Click(object sender, EventArgs e)
PublicVar.openFileName = Path.GetFileName(filePath);
}
TypedPassword.Value = null;
PublicVar.okPressed = false;
}
else
{
saveFileDialog.FileName = "Unnamed.cnp";
PublicVar.encryptionKey.Set(TypedPassword.Value);
PublicVar.okPressed = false;
if (saveFileDialog.ShowDialog() != DialogResult.OK)
{
TypedPassword.Value = null;
return;
}
richTextBox.Clear();
saveFileDialog.FileName = "Unnamed.cnp";
PublicVar.encryptionKey.Set(TypedPassword.Value);
StreamWriter sw = new StreamWriter(saveFileDialog.FileName);
string NameWithotPath = Path.GetFileName(saveFileDialog.FileName);
Text = PublicVar.appName + " " + NameWithotPath;