diff --git a/GUI/MainForm.cs b/GUI/MainForm.cs index c659ea0..caa5705 100644 --- a/GUI/MainForm.cs +++ b/GUI/MainForm.cs @@ -61,9 +61,12 @@ sealed public partial class MainForm : Form private void Decrypt(object sender, EventArgs e) { - ProcessBuilder pb = new ProcessBuilder(); - pb.ProcessFailed += (e) => MessageBox.Show(e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - CopyAndNotify(pb.GetOutput("gpg.exe", $"--quiet --decrypt {PathRequest()}\\{ResultList.Text}"), ResultList.Text); - Close(); + if (ResultList.Text != null) + { + ProcessBuilder pb = new ProcessBuilder(); + pb.ProcessFailed += (e) => MessageBox.Show(e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + CopyAndNotify(pb.GetOutput("gpg.exe", $"--quiet --decrypt {PathRequest()}\\{ResultList.Text}"), ResultList.Text); + Close(); + } } }