aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/keypair_details/KeyPairDetailTab.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2021-08-19 09:50:38 +0000
committerSaturneric <[email protected]>2021-08-19 09:50:38 +0000
commitce5296d5c5aae6270dd237d03fed4588f276266d (patch)
tree619905633d9204d0304a22cd0c45598092dc980a /src/ui/keypair_details/KeyPairDetailTab.cpp
parentBugs Fixed; Code Modified; (diff)
downloadGpgFrontend-ce5296d5c5aae6270dd237d03fed4588f276266d.tar.gz
GpgFrontend-ce5296d5c5aae6270dd237d03fed4588f276266d.zip
Bugs Fixed;
Diffstat (limited to '')
-rw-r--r--src/ui/keypair_details/KeyPairDetailTab.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ui/keypair_details/KeyPairDetailTab.cpp b/src/ui/keypair_details/KeyPairDetailTab.cpp
index c55c7c42..c0a2df99 100644
--- a/src/ui/keypair_details/KeyPairDetailTab.cpp
+++ b/src/ui/keypair_details/KeyPairDetailTab.cpp
@@ -214,7 +214,11 @@ void KeyPairDetailTab::slotExportPrivateKey() {
return;
}
- auto &key = mCtx->getKeyById(*keyid);
+ auto key = mCtx->getKeyById(*keyid);
+ if (!key.good) {
+ QMessageBox::critical(nullptr, tr("Error"), tr("Key Not Found."));
+ return;
+ }
QString fileString = key.name + " " + key.email + "(" +
key.id + ")_secret.asc";
QString fileName = QFileDialog::getSaveFileName(this, tr("Export Key To File"), fileString,
@@ -341,7 +345,7 @@ void KeyPairDetailTab::slotGenRevokeCert() {
QStringLiteral("%1 (*.rev)").arg(
tr("Revocation Certificates")));
- if(!mOutputFileName.isEmpty())
+ if (!mOutputFileName.isEmpty())
mCtx->generateRevokeCert(mKey, mOutputFileName);
}