Only append if the list is valid.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15941 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled 2007-04-20 16:56:10 +00:00
parent 98acaeba82
commit 01d7e59bc9

View File

@ -902,7 +902,8 @@ _get_template_split_account(GncSxInstance *instance, Split *template_split, Acco
g_string_printf(err, "Null account kvp value for SX [%s], cancelling creation.", g_string_printf(err, "Null account kvp value for SX [%s], cancelling creation.",
xaccSchedXactionGetName(instance->parent->sx)); xaccSchedXactionGetName(instance->parent->sx));
g_critical("%s", err->str); g_critical("%s", err->str);
*creation_errors = g_list_append(*creation_errors, err); if (creation_errors != NULL)
*creation_errors = g_list_append(*creation_errors, err);
return FALSE; return FALSE;
} }
acct_guid = kvp_value_get_guid( kvp_val ); acct_guid = kvp_value_get_guid( kvp_val );
@ -916,7 +917,9 @@ _get_template_split_account(GncSxInstance *instance, Split *template_split, Acco
g_string_printf(err, "Unknown account for guid [%s], cancelling SX [%s] creation.", g_string_printf(err, "Unknown account for guid [%s], cancelling SX [%s] creation.",
guid_str, xaccSchedXactionGetName(instance->parent->sx)); guid_str, xaccSchedXactionGetName(instance->parent->sx));
g_free((char*)guid_str); g_free((char*)guid_str);
*creation_errors = g_list_append(*creation_errors, err); g_critical("%s", err->str);
if (creation_errors != NULL)
*creation_errors = g_list_append(*creation_errors, err);
return FALSE; return FALSE;
} }
@ -951,7 +954,8 @@ _get_sx_formula_value(GncSxInstance *instance, Split *template_split, gnc_numeri
formula_str, formula_str,
parseErrorLoc, parseErrorLoc,
gnc_exp_parser_error_string()); gnc_exp_parser_error_string());
*creation_errors = g_list_append(*creation_errors, err); if (creation_errors != NULL)
*creation_errors = g_list_append(*creation_errors, err);
} }
if (parser_vars != NULL) if (parser_vars != NULL)