summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-06-11 16:06:52 +0200
committerChristian Grothoff <christian@grothoff.org>2017-06-11 16:06:52 +0200
commitba17729f6568efab7cacfc292670169437cbbda8 (patch)
treea612f621d119b85b6fcf608c502ff31fdf6e9bb5 /src
parentbecb7139e103a5ec8c18568a6cdbe756cb081ffd (diff)
downloadexchange-ba17729f6568efab7cacfc292670169437cbbda8.tar.gz
exchange-ba17729f6568efab7cacfc292670169437cbbda8.tar.bz2
exchange-ba17729f6568efab7cacfc292670169437cbbda8.zip
tolerate empty transaction list when returning history
Diffstat (limited to 'src')
-rw-r--r--src/bank-lib/fakebank.c7
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) )