From efc44b10040bd53563c171cda83e1c4ff12af18f Mon Sep 17 00:00:00 2001 From: fire-eggs Date: Tue, 18 May 2021 15:54:48 -0400 Subject: [PATCH] Fix issues #1075, #1055 : IG has no path for SaveAs in certain situations --- Source/ImageGlass/frmMain.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/ImageGlass/frmMain.cs b/Source/ImageGlass/frmMain.cs index a987a2cb2..020b77a5c 100644 --- a/Source/ImageGlass/frmMain.cs +++ b/Source/ImageGlass/frmMain.cs @@ -4313,7 +4313,11 @@ private void mnuMainSaveAs_Click(object sender, EventArgs e) { FileName = Path.GetFileNameWithoutExtension(currentFile), RestoreDirectory = true, }; - saveDialog.CustomPlaces.Add(Path.GetDirectoryName(currentFile)); + + // When saving image from clipboard, there is no path (issue #1075) + // In the window of time while IG is populating the image list, there is no path (issue #1055) + var path2 = string.IsNullOrEmpty(currentFile) ? currentFile : Path.GetDirectoryName(currentFile); + saveDialog.CustomPlaces.Add(path2); // Use the last-selected file extension, if available.