aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/widgets/KeyList.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2025-04-16 00:53:22 +0000
committersaturneric <[email protected]>2025-04-16 00:53:22 +0000
commit2027237de006cb9fa40a73365cbbc8911572969c (patch)
tree4c05dec8b1d7ae7b2afa3b7056052cb7968af9f8 /src/ui/widgets/KeyList.cpp
parentfeat: support key groups (diff)
downloadGpgFrontend-2027237de006cb9fa40a73365cbbc8911572969c.tar.gz
GpgFrontend-2027237de006cb9fa40a73365cbbc8911572969c.zip
fix: found bugs
Diffstat (limited to '')
-rw-r--r--src/ui/widgets/KeyList.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ui/widgets/KeyList.cpp b/src/ui/widgets/KeyList.cpp
index 429a5bd1..53adb316 100644
--- a/src/ui/widgets/KeyList.cpp
+++ b/src/ui/widgets/KeyList.cpp
@@ -507,11 +507,15 @@ void KeyList::import_keys(const QByteArray& in_buffer) {
}
auto KeyList::GetSelectedKey() -> GpgAbstractKeyPtr {
- return GetSelectedKeys().front();
+ auto k = GetSelectedKeys();
+ if (k.empty()) return nullptr;
+ return k.front();
}
auto KeyList::GetSelectedGpgKey() -> GpgKeyPtr {
- return GetSelectedGpgKeys().front();
+ auto k = GetSelectedGpgKeys();
+ if (k.empty()) return nullptr;
+ return k.front();
}
auto KeyList::GetSelectedGpgKeys() -> GpgKeyPtrList {