From 67a081d69e2b208e369f0658dd45f3c19cbe9bb7 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Fri, 1 Sep 2006 21:10:53 +0000 Subject: [PATCH] Fix crash when querying data of the already deleted template_list_store of the transfer dialog. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14781 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/import-export/hbci/gnc-hbci-transfer.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/import-export/hbci/gnc-hbci-transfer.c b/src/import-export/hbci/gnc-hbci-transfer.c index bbcca22500..686ab330f7 100644 --- a/src/import-export/hbci/gnc-hbci-transfer.c +++ b/src/import-export/hbci/gnc-hbci-transfer.c @@ -101,6 +101,13 @@ gnc_hbci_maketrans (GtkWidget *parent, Account *gnc_acc, /* Let the user enter the values. If cancel is pressed, -1 is returned. */ result = gnc_hbci_dialog_run_until_ok(td, h_acc); + if ((result != GNC_RESPONSE_NOW) && (result != GNC_RESPONSE_LATER)) { + /* If cancel has been pressed, the dialog doesn't exist + anymore and we cannot query for the template + list. Therefore break immediately. */ + break; + } + /* Set the template list in case it got modified. */ if (template_list) g_list_free(template_list); @@ -111,10 +118,6 @@ gnc_hbci_maketrans (GtkWidget *parent, Account *gnc_acc, maketrans_save_templates(parent, gnc_acc, template_list, (result == GNC_RESPONSE_NOW)); - if ((result != GNC_RESPONSE_NOW) && (result != GNC_RESPONSE_LATER)) { - break; - } - /* Make really sure the dialog is hidden now. */ gnc_hbci_dialog_hide(td);