From e130e5d90f70c1919807524779723c68040d7afa Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 26 Oct 2019 00:12:19 +0300 Subject: [PATCH] Fixed bug with password corrupt while creating new file --- Crypto Notepad/MainForm.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Crypto Notepad/MainForm.cs b/Crypto Notepad/MainForm.cs index 84d902e..cf7480f 100644 --- a/Crypto Notepad/MainForm.cs +++ b/Crypto Notepad/MainForm.cs @@ -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;