Skip to content

Commit cbf0f88

Browse files
committed
Add nice error message for export
1 parent a9f464e commit cbf0f88

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/PageViewModel.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,13 @@ public void ShowExecute()
5353

5454
public void ShowExport()
5555
{
56+
57+
if (!File.Exists(Configuration.OutputFile))
58+
{
59+
MessageBox.Show("The output file has not generated yet", "Export", MessageBoxButton.OK, MessageBoxImage.Error);
60+
return;
61+
}
62+
5663
var filter = $"*{Path.GetExtension(Configuration.OutputFile)}";
5764
var dialog = new Microsoft.Win32.SaveFileDialog
5865
{
@@ -64,12 +71,6 @@ public void ShowExport()
6471
if (!result)
6572
return;
6673

67-
if (!File.Exists(Configuration.OutputFile))
68-
{
69-
MessageBox.Show("Output file not generated yet", "Export", MessageBoxButton.OK);
70-
return;
71-
}
72-
7374
try
7475
{
7576
File.Copy(Configuration.OutputFile, dialog.FileName);

0 commit comments

Comments
 (0)