r17060 - gnucash/trunk/src/gnome-utils - Avoid a critical warning in the transfer dialog.

Andreas Köhler andi5 at cvs.gnucash.org
Sat Mar 29 09:38:11 EDT 2008


Author: andi5
Date: 2008-03-29 09:38:11 -0400 (Sat, 29 Mar 2008)
New Revision: 17060
Trac: http://svn.gnucash.org/trac/changeset/17060

Modified:
   gnucash/trunk/src/gnome-utils/dialog-transfer.c
Log:
Avoid a critical warning in the transfer dialog.

When entering interest charges, the left account tree is grayed out and
a selection-changed signal with empty selection fired.  Do not process
that NULL account.


Modified: gnucash/trunk/src/gnome-utils/dialog-transfer.c
===================================================================
--- gnucash/trunk/src/gnome-utils/dialog-transfer.c	2008-03-29 13:38:01 UTC (rev 17059)
+++ gnucash/trunk/src/gnome-utils/dialog-transfer.c	2008-03-29 13:38:11 UTC (rev 17060)
@@ -372,6 +372,9 @@
   Account *account;
 
   account = gnc_transfer_dialog_get_selected_account (xferData, XFER_DIALOG_FROM);
+  if (!account)
+    return;
+
   commodity = xaccAccountGetCommodity(account);
   gtk_label_set_text(GTK_LABEL(xferData->from_currency_label), 
 		     gnc_commodity_get_printname(commodity));
@@ -402,6 +405,9 @@
   Account *account;
 
   account = gnc_transfer_dialog_get_selected_account (xferData, XFER_DIALOG_TO);
+  if (!account)
+    return;
+
   commodity = xaccAccountGetCommodity(account);
   gtk_label_set_text(GTK_LABEL(xferData->to_currency_label),
 		     gnc_commodity_get_printname(commodity));



More information about the gnucash-changes mailing list