aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/main_window/MainWindowGpgOperaFunction.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-10-26 13:51:55 +0000
committersaturneric <[email protected]>2024-10-26 13:51:55 +0000
commit5bc8c1cd21c18af82a9bf6ffd96457afda46a7bd (patch)
treecfaa815bd4492ec98a8709be0e4628be6911161b /src/ui/main_window/MainWindowGpgOperaFunction.cpp
parentfix: add a resource item (diff)
downloadGpgFrontend-5bc8c1cd21c18af82a9bf6ffd96457afda46a7bd.tar.gz
GpgFrontend-5bc8c1cd21c18af82a9bf6ffd96457afda46a7bd.zip
fix: should check key status immediately after get it
Diffstat (limited to 'src/ui/main_window/MainWindowGpgOperaFunction.cpp')
-rw-r--r--src/ui/main_window/MainWindowGpgOperaFunction.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ui/main_window/MainWindowGpgOperaFunction.cpp b/src/ui/main_window/MainWindowGpgOperaFunction.cpp
index 824fdd23..5069f600 100644
--- a/src/ui/main_window/MainWindowGpgOperaFunction.cpp
+++ b/src/ui/main_window/MainWindowGpgOperaFunction.cpp
@@ -102,6 +102,10 @@ void MainWindow::SlotEncrypt() {
GpgKeyGetter::GetInstance(m_key_list_->GetCurrentGpgContextChannel())
.GetKeys(key_ids);
for (const auto& key : *keys) {
+ assert(key.IsGood());
+ }
+
+ for (const auto& key : *keys) {
if (!key.IsHasActualEncryptionCapability()) {
QMessageBox::information(
this, tr("Invalid Operation"),