Skip to content

Commit 6a44aa9

Browse files
committed
Create folders if required
1 parent 4ca09c8 commit 6a44aa9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

PasteIntoFile/frmMain.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public frmMain(string location = null, string filename = null)
5454

5555
//
5656

57-
var filenameFormat = Settings.Default.filenameTemplate ?? DefaultFilenameFormat;
57+
var filenameFormat = string.IsNullOrWhiteSpace(Settings.Default.filenameTemplate) ? DefaultFilenameFormat : Settings.Default.filenameTemplate;
5858
txtFilename.Text = DateTime.Now.ToString(filenameFormat);
5959
txtCurrentLocation.Text = Path.GetFullPath(location);
6060
chkClrClipboard.Checked = Settings.Default.clrClipboard;
@@ -161,6 +161,9 @@ string save()
161161
}
162162
}
163163

164+
// create folders if required
165+
Directory.CreateDirectory(txtCurrentLocation.Text);
166+
164167
try
165168
{
166169
if (text != null)

0 commit comments

Comments
 (0)