From 0b20150ab78b841c580dc0a61e3d943467d0f234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miskolczi=20Rich=C3=A1rd?= Date: Tue, 4 Apr 2023 11:02:38 +0200 Subject: [PATCH] Nothing happens if no password was found and you press Decrypt --- GUI/MainForm.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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(); + } } }