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; struct _accountpickerdialog * picker;
gint response; gint response;
Account * retval = NULL; Account * retval = NULL;
const gchar *retval_name = NULL;
GladeXML *xml; GladeXML *xml;
GtkWidget * online_id_label, *button; GtkWidget * online_id_label, *button;
gchar account_description_text[ACCOUNT_DESCRIPTION_MAX_SIZE] = ""; gchar account_description_text[ACCOUNT_DESCRIPTION_MAX_SIZE] = "";
@ -225,7 +226,9 @@ Account * gnc_import_select_account(gncUIWidget parent,
switch (response) { switch (response) {
case GTK_RESPONSE_OK: case GTK_RESPONSE_OK:
retval = gnc_tree_view_account_get_selected_account(picker->account_tree); 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. */ /* See if the selected account is a placeholder. */
if (xaccAccountGetPlaceholder (retval)) { if (xaccAccountGetPlaceholder (retval)) {
@ -233,7 +236,7 @@ Account * gnc_import_select_account(gncUIWidget parent,
(picker->dialog, (picker->dialog,
_("The account %s is a placeholder account and does not allow " _("The account %s is a placeholder account and does not allow "
"transactions. Please choose a different account."), "transactions. Please choose a different account."),
xaccAccountGetName (retval)); retval_name ? retval_name : "(null)");
response = GNC_RESPONSE_NEW; response = GNC_RESPONSE_NEW;
break; break;
} }
@ -256,6 +259,7 @@ Account * gnc_import_select_account(gncUIWidget parent,
} }
else else
{ {
retval_name = xaccAccountGetName(retval);
ok_pressed_retval=TRUE; /* There was no dialog involved, so the computer "pressed" ok */ 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"); */ /*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; *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; return retval;
} }
/**@}*/ /**@}*/