tolerate empty transaction list when returning history
This commit is contained in:
parent
becb7139e1
commit
ba17729f65
@ -521,7 +521,7 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
|
|||||||
else
|
else
|
||||||
pos = h->transactions_tail;
|
pos = h->transactions_tail;
|
||||||
}
|
}
|
||||||
else
|
else if (NULL != h->transactions_head)
|
||||||
{
|
{
|
||||||
for (pos = h->transactions_head;
|
for (pos = h->transactions_head;
|
||||||
NULL != pos;
|
NULL != pos;
|
||||||
@ -539,6 +539,11 @@ handle_history (struct TALER_FAKEBANK_Handle *h,
|
|||||||
if (count < 0)
|
if (count < 0)
|
||||||
pos = pos->prev;
|
pos = pos->prev;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* list is empty */
|
||||||
|
pos = NULL;
|
||||||
|
}
|
||||||
history = json_array ();
|
history = json_array ();
|
||||||
while ( (NULL != pos) &&
|
while ( (NULL != pos) &&
|
||||||
(0 != count) )
|
(0 != count) )
|
||||||
|
Loading…
Reference in New Issue
Block a user