From f05128b2c25e8d970aa275e632812d7671c5e89b Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sat, 28 Mar 2020 09:18:54 +0800 Subject: [PATCH] Bug 797583 - gnc:book-add-quotes crashes when there are no quotes When Get Quotes being run on empty book, the gnc:book-add-quotes function expects book->commodity->fq-call-data to return #f --- libgnucash/scm/price-quotes.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libgnucash/scm/price-quotes.scm b/libgnucash/scm/price-quotes.scm index 0565000bfd..0515be00ca 100644 --- a/libgnucash/scm/price-quotes.scm +++ b/libgnucash/scm/price-quotes.scm @@ -199,10 +199,11 @@ commodity-list) ;; Now translate to just what gnc-fq-helper expects. - (append - (hash-map->list cons commodity-hash) - (map (lambda (cmd) (cons (car cmd) (list (cdr cmd)))) - currency-list-filtered))))) + (and (or (pair? currency-list-filtered) (pair? commodity-list)) + (append + (hash-map->list cons commodity-hash) + (map (lambda (cmd) (cons (car cmd) (list (cdr cmd)))) + currency-list-filtered)))))) (define (fq-call-data->fq-calls fq-call-data) ;; take an output element from book->commodity->fq-call-data and