aboutsummaryrefslogtreecommitdiff
path: root/src/exchange-lib/exchange_api_handle.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-10-10 16:54:37 +0200
committerChristian Grothoff <christian@grothoff.org>2016-10-10 16:54:37 +0200
commit25618c561e55fb82ab2b3701a4e207106300711f (patch)
tree7b06f0989dfa5ba1ce7f22e28952c1a79c706266 /src/exchange-lib/exchange_api_handle.c
parent808dc10bf4c0bffda06a2f617f361a0c2ea7ef58 (diff)
check dbinit return value to not fail hard if DB not available
Diffstat (limited to 'src/exchange-lib/exchange_api_handle.c')
-rw-r--r--src/exchange-lib/exchange_api_handle.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/exchange-lib/exchange_api_handle.c b/src/exchange-lib/exchange_api_handle.c
index 06dc2bf8d..152114850 100644
--- a/src/exchange-lib/exchange_api_handle.c
+++ b/src/exchange-lib/exchange_api_handle.c
@@ -554,7 +554,12 @@ decode_keys_json (const json_t *resp_obj,
EXITIF (NULL == (denom_keys_array =
json_object_get (resp_obj, "denoms")));
EXITIF (JSON_ARRAY != json_typeof (denom_keys_array));
- EXITIF (0 == (key_data->num_denom_keys = json_array_size (denom_keys_array)));
+ if (0 == (key_data->num_denom_keys = json_array_size (denom_keys_array)))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Found no denomination keys at this exchange\n");
+ goto EXITIF_exit;
+ }
key_data->denom_keys = GNUNET_new_array (key_data->num_denom_keys,
struct TALER_EXCHANGE_DenomPublicKey);
index = 0;