aboutsummaryrefslogtreecommitdiffstats
path: root/src/ui/UserInterfaceUtils.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-06-05 11:39:38 +0000
committerSaturneric <[email protected]>2022-06-05 11:40:22 +0000
commit96009aba6df716ac3abdae1acdfa32125681bbf1 (patch)
tree5dc8e78ea5903a85062676ac69fb41abcc611ef1 /src/ui/UserInterfaceUtils.cpp
parentfix(ui): fix crash when start app. (diff)
downloadGpgFrontend-96009aba6df716ac3abdae1acdfa32125681bbf1.tar.gz
GpgFrontend-96009aba6df716ac3abdae1acdfa32125681bbf1.zip
fix: fix some issues
1. fix crash when keyserver list is empty. 2. refactor KeyServerImportDialog 3. reduce header file including
Diffstat (limited to 'src/ui/UserInterfaceUtils.cpp')
-rw-r--r--src/ui/UserInterfaceUtils.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ui/UserInterfaceUtils.cpp b/src/ui/UserInterfaceUtils.cpp
index adcbd6ff..586d72ab 100644
--- a/src/ui/UserInterfaceUtils.cpp
+++ b/src/ui/UserInterfaceUtils.cpp
@@ -276,6 +276,9 @@ void CommonUtils::SlotImportKeyFromKeyServer(
const int target_key_server_index =
key_server_json.Check("default_server", 0);
+ if (target_key_server_index >= key_server_list.size()) {
+ throw std::runtime_error("default_server index out of range");
+ }
target_keyserver =
key_server_list[target_key_server_index].get<std::string>();