Fixed bug with empty filename field while saving/creating a file

This commit is contained in:
Alexander 2018-12-10 14:47:36 +02:00
parent 510547fd76
commit 7b5562c757

View file

@ -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();
@ -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);
@ -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();