2003-04-03 Benoit Gr�goire <bock@step.polymtl.ca>

* src/import-export/import-commodity-matcher.c: Fix debian bug #187061
	Crash during import of investment accounts.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8181 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Benoit Grégoire 2003-04-03 16:06:05 +00:00
parent 07f773530f
commit 16d283bcb4
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2003-04-03 Benoit Grégoire <bock@step.polymtl.ca>
* src/import-export/import-commodity-matcher.c: Fix debian bug #187061
Crash during import of investment accounts.
2003-04-02 Benoit Grégoire <bock@step.polymtl.ca>
* po/POTFILES.in,

View File

@ -93,7 +93,9 @@ gnc_commodity * gnc_import_select_commodity(char * exchange_code,
tmp_commodity=commodity_list->data;
DEBUG("Looking at commodity %s",gnc_commodity_get_fullname(tmp_commodity));
if(strncmp(gnc_commodity_get_exchange_code(tmp_commodity),exchange_code,strlen(exchange_code))==0)
if(gnc_commodity_get_exchange_code(tmp_commodity)!=NULL &&
exchange_code != NULL &&
strncmp(gnc_commodity_get_exchange_code(tmp_commodity),exchange_code,strlen(exchange_code))==0)
{
retval = tmp_commodity;
DEBUG("Commodity %s%s",gnc_commodity_get_fullname(retval)," matches.");
@ -115,14 +117,17 @@ gnc_commodity * gnc_import_select_commodity(char * exchange_code,
{
retval=gnc_ui_select_commodity_modal_full(NULL,
NULL,
_("Please select a commodity to match the following exchange code.\nPlease note that the exchange code of the commodity you select will be overwritten."),
_("Please select a commodity to match the following exchange code.\nPlease note that the exchange code of the commodity you select will be overwritten.\n"),
exchange_code,
default_fullname,
default_mnemonic,
0);
}
if (retval != NULL&&(strncmp(gnc_commodity_get_exchange_code(retval),exchange_code,strlen(exchange_code))!=0))
if (retval != NULL&&
gnc_commodity_get_exchange_code(tmp_commodity)!=NULL &&
exchange_code != NULL &&
(strncmp(gnc_commodity_get_exchange_code(retval),exchange_code,strlen(exchange_code))!=0))
{
gnc_commodity_set_exchange_code(retval,
exchange_code);