From 9d28edb332559723bd6fe1ba71973f92b146137b Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sun, 9 Aug 2020 13:27:59 +0800 Subject: [PATCH] [gnucash-commands.cpp] fix guile error handling * id is an SCM object which is never NULL, but may be #f to signal error. --- gnucash/gnucash-commands.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnucash/gnucash-commands.cpp b/gnucash/gnucash-commands.cpp index 87a1995cb4..44b02b2454 100644 --- a/gnucash/gnucash-commands.cpp +++ b/gnucash/gnucash-commands.cpp @@ -215,13 +215,16 @@ scm_run_report (void *data, if (!args->export_type.empty()) { - scm_call_3(run_export_cmd, report, type, file); + SCM retval = scm_call_3(run_export_cmd, report, type, file); + + if (scm_is_false (retval)) + scm_cleanup_and_exit_with_failure (nullptr); } else { SCM id = scm_call_1(get_report_cmd, report); - if (!id) + if (scm_is_false (id)) scm_cleanup_and_exit_with_failure (nullptr); char* html; gnc_run_report (scm_to_int(id), &html);