From 524dc04434f2f2a90a49d539886813741de862fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Thu, 24 Jul 2008 23:46:14 +0000 Subject: [PATCH] Handle missing information when importing from aqbanking more gracefully. The online_id used to match an aqbanking accountinfo to a gnucash account is the concatenation of the bank code and account number found. If the primer is NULL, then fall back to "" instead of invalidating the whole id. BP git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17405 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/import-export/aqbanking/gnc-ab-utils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/import-export/aqbanking/gnc-ab-utils.c b/src/import-export/aqbanking/gnc-ab-utils.c index b978710b76..d886514038 100644 --- a/src/import-export/aqbanking/gnc-ab-utils.c +++ b/src/import-export/aqbanking/gnc-ab-utils.c @@ -428,13 +428,16 @@ gnc_ab_trans_to_gnc(const AB_TRANSACTION *ab_trans, Account *gnc_acc) static Account * gnc_ab_accinfo_to_gnc_acc(AB_IMEXPORTER_ACCOUNTINFO *acc_info) { + const gchar *bankcode, *accountnumber; gchar *online_id; Account *gnc_acc; g_return_val_if_fail(acc_info, NULL); - online_id = g_strconcat(AB_ImExporterAccountInfo_GetBankCode(acc_info), - AB_ImExporterAccountInfo_GetAccountNumber(acc_info), + bankcode = AB_ImExporterAccountInfo_GetBankCode(acc_info); + accountnumber = AB_ImExporterAccountInfo_GetAccountNumber(acc_info); + online_id = g_strconcat(bankcode ? bankcode : "", + accountnumber ? accountnumber : "", (gchar*)NULL); gnc_acc = gnc_import_select_account( NULL, online_id, 1, AB_ImExporterAccountInfo_GetAccountName(acc_info),