From 2b0953a4fb208ec8baab3dc1d6dc3c726a7459ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Mon, 24 Mar 2008 17:02:38 +0000 Subject: [PATCH] Avoid critical warnings in the import account matcher dialog. If no account is selected, simply do not call engine functions on it. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17043 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/import-export/import-account-matcher.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/import-export/import-account-matcher.c b/src/import-export/import-account-matcher.c index 8227b8a4c0..008c26f526 100644 --- a/src/import-export/import-account-matcher.c +++ b/src/import-export/import-account-matcher.c @@ -228,17 +228,19 @@ Account * gnc_import_select_account(gncUIWidget parent, switch (response) { case GTK_RESPONSE_OK: retval = gnc_tree_view_account_get_selected_account(picker->account_tree); - retval_name = xaccAccountGetName(retval); - DEBUG("Selected account %p, %s", retval, - retval_name ? retval_name : "(null)"); + if (retval) + retval_name = xaccAccountGetName(retval); + if (!retval_name) + retval_name = "(null)"; + DEBUG("Selected account %p, %s", retval, retval_name); /* See if the selected account is a placeholder. */ - if (xaccAccountGetPlaceholder (retval)) { + if (retval && xaccAccountGetPlaceholder (retval)) { gnc_error_dialog (picker->dialog, _("The account %s is a placeholder account and does not allow " "transactions. Please choose a different account."), - retval_name ? retval_name : "(null)"); + retval_name); response = GNC_RESPONSE_NEW; break; }