aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/function/KeyPackageOperator.cpp
diff options
context:
space:
mode:
authorsaturneric <[email protected]>2024-01-17 11:39:47 +0000
committersaturneric <[email protected]>2024-01-17 11:39:47 +0000
commite352e8e6b8d03a24ef5d52eef3e4d370807b5bbd (patch)
tree9a59f0b573a845644afe4b8857a89c4b28bdcc0d /src/core/function/KeyPackageOperator.cpp
parentfix: solve the gnupg tab options info not shown issue (diff)
downloadGpgFrontend-e352e8e6b8d03a24ef5d52eef3e4d370807b5bbd.tar.gz
GpgFrontend-e352e8e6b8d03a24ef5d52eef3e4d370807b5bbd.zip
fix: find and slove some bugs
Diffstat (limited to 'src/core/function/KeyPackageOperator.cpp')
-rw-r--r--src/core/function/KeyPackageOperator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/function/KeyPackageOperator.cpp b/src/core/function/KeyPackageOperator.cpp
index d15859a3..abb84512 100644
--- a/src/core/function/KeyPackageOperator.cpp
+++ b/src/core/function/KeyPackageOperator.cpp
@@ -64,8 +64,10 @@ void KeyPackageOperator::GenerateKeyPackage(const QString& key_package_path,
return;
}
- if (data_obj == nullptr || !data_obj->Check<GFBuffer>()) {
- throw std::runtime_error("data object doesn't pass checking");
+ if (CheckGpgError(err) == GPG_ERR_USER_1 || data_obj == nullptr ||
+ !data_obj->Check<GFBuffer>()) {
+ cb(-1, data_obj);
+ return;
}
auto gf_buffer = ExtractParams<GFBuffer>(data_obj, 0);