diff options
author | saturneric <[email protected]> | 2025-04-16 00:53:22 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2025-04-16 00:53:22 +0000 |
commit | 2027237de006cb9fa40a73365cbbc8911572969c (patch) | |
tree | 4c05dec8b1d7ae7b2afa3b7056052cb7968af9f8 /src/ui/widgets/KeyList.cpp | |
parent | feat: support key groups (diff) | |
download | GpgFrontend-2027237de006cb9fa40a73365cbbc8911572969c.tar.gz GpgFrontend-2027237de006cb9fa40a73365cbbc8911572969c.zip |
fix: found bugs
Diffstat (limited to 'src/ui/widgets/KeyList.cpp')
-rw-r--r-- | src/ui/widgets/KeyList.cpp | 8 |
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 { |