Fix NULL-%s-printf in gnc_import_select_account. Fixes #430130.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15909 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2007-04-16 08:26:18 +00:00
parent 8a8fb70a8a
commit 6627ae75ab

View File

@ -152,6 +152,7 @@ Account * gnc_import_select_account(gncUIWidget parent,
struct _accountpickerdialog * picker;
gint response;
Account * retval = NULL;
const gchar *retval_name = NULL;
GladeXML *xml;
GtkWidget * online_id_label, *button;
gchar account_description_text[ACCOUNT_DESCRIPTION_MAX_SIZE] = "";
@ -225,7 +226,9 @@ Account * gnc_import_select_account(gncUIWidget parent,
switch (response) {
case GTK_RESPONSE_OK:
retval = gnc_tree_view_account_get_selected_account(picker->account_tree);
DEBUG("Selected account %p, %s", retval, xaccAccountGetName(retval));
retval_name = xaccAccountGetName(retval);
DEBUG("Selected account %p, %s", retval,
retval_name ? retval_name : "(null)");
/* See if the selected account is a placeholder. */
if (xaccAccountGetPlaceholder (retval)) {
@ -233,7 +236,7 @@ Account * gnc_import_select_account(gncUIWidget parent,
(picker->dialog,
_("The account %s is a placeholder account and does not allow "
"transactions. Please choose a different account."),
xaccAccountGetName (retval));
retval_name ? retval_name : "(null)");
response = GNC_RESPONSE_NEW;
break;
}
@ -256,6 +259,7 @@ Account * gnc_import_select_account(gncUIWidget parent,
}
else
{
retval_name = xaccAccountGetName(retval);
ok_pressed_retval=TRUE; /* There was no dialog involved, so the computer "pressed" ok */
}
/*FIXME: DEBUG("WRITEME: gnc_import_select_account() Here we should check if account type is compatible, currency matches, etc.\n"); */
@ -265,7 +269,7 @@ Account * gnc_import_select_account(gncUIWidget parent,
{
*ok_pressed=ok_pressed_retval;
}
LEAVE("Selected account %p, %s", retval, xaccAccountGetName(retval));
LEAVE("Selected account %p, %s", retval, retval_name ? retval_name : "(null)");
return retval;
}
/**@}*/