From 25618c561e55fb82ab2b3701a4e207106300711f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 10 Oct 2016 16:54:37 +0200 Subject: check dbinit return value to not fail hard if DB not available --- src/exchange-lib/exchange_api_handle.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/exchange-lib/exchange_api_handle.c') diff --git a/src/exchange-lib/exchange_api_handle.c b/src/exchange-lib/exchange_api_handle.c index 06dc2bf8..15211485 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; -- cgit v1.2.3