Nothing happens if no password was found and you press Decrypt

This commit is contained in:
2023-04-04 11:02:38 +02:00
parent ec33a6fb7a
commit 0b20150ab7

View File

@@ -60,10 +60,13 @@ sealed public partial class MainForm : Form
} }
private void Decrypt(object sender, EventArgs e) private void Decrypt(object sender, EventArgs e)
{
if (ResultList.Text != null)
{ {
ProcessBuilder pb = new ProcessBuilder(); ProcessBuilder pb = new ProcessBuilder();
pb.ProcessFailed += (e) => MessageBox.Show(e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); pb.ProcessFailed += (e) => MessageBox.Show(e.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
CopyAndNotify(pb.GetOutput("gpg.exe", $"--quiet --decrypt {PathRequest()}\\{ResultList.Text}"), ResultList.Text); CopyAndNotify(pb.GetOutput("gpg.exe", $"--quiet --decrypt {PathRequest()}\\{ResultList.Text}"), ResultList.Text);
Close(); Close();
} }
}
} }