diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-06-11 16:06:52 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-06-11 16:06:52 +0200 |
commit | ba17729f6568efab7cacfc292670169437cbbda8 (patch) | |
tree | a612f621d119b85b6fcf608c502ff31fdf6e9bb5 /src | |
parent | becb7139e103a5ec8c18568a6cdbe756cb081ffd (diff) | |
download | exchange-ba17729f6568efab7cacfc292670169437cbbda8.tar.xz |
tolerate empty transaction list when returning history
Diffstat (limited to 'src')
-rw-r--r-- | src/bank-lib/fakebank.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bank-lib/fakebank.c b/src/bank-lib/fakebank.c index 0b67b7fa4..037698c35 100644 --- a/src/bank-lib/fakebank.c +++ b/src/bank-lib/fakebank.c @@ -521,7 +521,7 @@ handle_history (struct TALER_FAKEBANK_Handle *h, else pos = h->transactions_tail; } - else + else if (NULL != h->transactions_head) { for (pos = h->transactions_head; NULL != pos; @@ -539,6 +539,11 @@ handle_history (struct TALER_FAKEBANK_Handle *h, if (count < 0) pos = pos->prev; } + else + { + /* list is empty */ + pos = NULL; + } history = json_array (); while ( (NULL != pos) && (0 != count) ) |