From ea0982eb3367ad267124e5bf90deab48411aceca Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Tue, 7 May 2019 15:52:09 +0100 Subject: [PATCH] Stop some errors when cancelling the QIF import The imported_account_tree variable is only set when the 'start import' button is pressed on assistant page 'QIF import' so only process the undo from there. --- gnucash/import-export/qif-imp/assistant-qif-import.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnucash/import-export/qif-imp/assistant-qif-import.c b/gnucash/import-export/qif-imp/assistant-qif-import.c index e7cb53f20b..edc448bcbb 100644 --- a/gnucash/import-export/qif-imp/assistant-qif-import.c +++ b/gnucash/import-export/qif-imp/assistant-qif-import.c @@ -1110,7 +1110,8 @@ gnc_ui_qif_import_convert_undo (QIFImportWindow * wind) gnc_set_busy_cursor (NULL, TRUE); /* Undo the conversion. */ - gfec_apply (undo, wind->imported_account_tree, _gfec_error_handler); + if (wind->imported_account_tree != SCM_BOOL_F) + gfec_apply (undo, wind->imported_account_tree, _gfec_error_handler); /* There's no imported account tree any more. */ scm_gc_unprotect_object (wind->imported_account_tree);