diff --git a/src/business/business-ledger/gncEntryLedger.c b/src/business/business-ledger/gncEntryLedger.c index f80231d112..ba9dbced3c 100644 --- a/src/business/business-ledger/gncEntryLedger.c +++ b/src/business/business-ledger/gncEntryLedger.c @@ -426,7 +426,7 @@ static void create_invoice_query (GncEntryLedger *ledger) * ( Entry->Billable == TRUE AND * Entry->Bill->Is-Posted? == TRUE AND * ( Entry->BillTo == Invoice->parent OR - * Entry->Bill->BillTo == Invoice->parent ) ) + * ( Entry->BillTo == NULL AND Entry->Bill->BillTo == Invoice->parent ) ) ) * OR * ( Entry->Order->real-parent == Invoice->parent ) ) * #endif diff --git a/src/libqof/qof/qofquerycore.c b/src/libqof/qof/qofquerycore.c index 97be12c2ab..8fa2109e73 100644 --- a/src/libqof/qof/qofquerycore.c +++ b/src/libqof/qof/qofquerycore.c @@ -730,7 +730,9 @@ qof_query_guid_predicate (QofGuidMatch options, GList *guid_list) query_guid_t pdata; GList *node; - if (NULL == guid_list) return NULL; + /* An empty list of guids is only valid when testing for a null GUID value */ + if (!guid_list) + g_return_val_if_fail (options == QOF_GUID_MATCH_NULL, NULL); pdata = g_new0 (query_guid_def, 1); pdata->pd.how = QOF_COMPARE_EQUAL;