Skip to content

Commit

Permalink
Fixed bug with empty filename field while saving/creating a file
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigmanor committed Dec 10, 2018
1 parent 510547f commit 7b5562c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Crypto Notepad/Form1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ private void openAsotiations()

private void newToolStripMenuItem_Click_1(object sender, EventArgs e)
{
saveConfirm(false);
SaveFile.FileName = "Unnamed.cnp";
publicVar.openFileName = "Crypto Notepad";
Form2 f2 = new Form2();
f2.ShowDialog();

Expand All @@ -185,6 +188,7 @@ private void newToolStripMenuItem_Click_1(object sender, EventArgs e)
{
return;
}

customRTB.Clear();
StreamWriter sw = new StreamWriter(SaveFile.FileName);
string NameWithotPath = Path.GetFileName(SaveFile.FileName);
Expand All @@ -198,6 +202,7 @@ private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
{
int saveCaret = customRTB.SelectionStart;
string NameWithotPath = Path.GetFileName(OpenFile.FileName);
SaveFile.FileName = currentFilename;
if (string.IsNullOrEmpty(publicVar.encryptionKey.Get()))
{
Form2 Form2 = new Form2();
Expand Down

0 comments on commit 7b5562c

Please sign in to comment.