aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowSlotFunction.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/main_window/MainWindowSlotFunction.cpp
parentBugs Fixed; Code Modified; (diff)
downloadGpgFrontend-ce5296d5c5aae6270dd237d03fed4588f276266d.tar.gz
GpgFrontend-ce5296d5c5aae6270dd237d03fed4588f276266d.zip
Bugs Fixed;
Diffstat (limited to 'src/ui/main_window/MainWindowSlotFunction.cpp')
-rw-r--r--src/ui/main_window/MainWindowSlotFunction.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ui/main_window/MainWindowSlotFunction.cpp b/src/ui/main_window/MainWindowSlotFunction.cpp
index 13af25ed..d6f1e880 100644
--- a/src/ui/main_window/MainWindowSlotFunction.cpp
+++ b/src/ui/main_window/MainWindowSlotFunction.cpp
@@ -481,7 +481,11 @@ void MainWindow::slotCopyMailAddressToClipboard() {
if (mKeyList->getSelected()->isEmpty()) {
return;
}
- auto &key = mCtx->getKeyById(mKeyList->getSelected()->first());
+ auto key = mCtx->getKeyById(mKeyList->getSelected()->first());
+ if (!key.good) {
+ QMessageBox::critical(nullptr, tr("Error"), tr("Key Not Found."));
+ return;
+ }
QClipboard *cb = QApplication::clipboard();
QString mail = key.email;
cb->setText(mail);
@@ -491,9 +495,11 @@ void MainWindow::slotShowKeyDetails() {
if (mKeyList->getSelected()->isEmpty()) {
return;
}
- auto &key = mCtx->getKeyById(mKeyList->getSelected()->first());
+ auto key = mCtx->getKeyById(mKeyList->getSelected()->first());
if (key.good) {
new KeyDetailsDialog(mCtx, key, this);
+ } else {
+ QMessageBox::critical(nullptr, tr("Error"), tr("Key Not Found."));
}
}