mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Instrument failure to set the account when creating a split.
This commit is contained in:
parent
2d3e80ea08
commit
f24c2c8bdd
@ -187,6 +187,7 @@ public:
|
||||
void* pObject, T get_ref)
|
||||
const noexcept
|
||||
{
|
||||
static QofLogModule log_module = G_LOG_DOMAIN;
|
||||
g_return_if_fail (pObject != NULL);
|
||||
|
||||
try
|
||||
@ -199,9 +200,19 @@ public:
|
||||
if (target != nullptr)
|
||||
set_parameter (pObject, target, get_setter(obj_name),
|
||||
m_gobj_param_name);
|
||||
else
|
||||
DEBUG("GUID %s returned null %s reference.",
|
||||
val.c_str(), m_gobj_param_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (val.empty()) DEBUG("Can't load empty guid string for column %s", m_col_name);
|
||||
else DEBUG("Invalid GUID %s for column %s", val.c_str(), m_col_name);
|
||||
}
|
||||
}
|
||||
catch (std::invalid_argument&) {}
|
||||
catch (std::invalid_argument& err) {
|
||||
DEBUG("set_parameter threw %s for column %s", err.what(), m_col_name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -239,6 +239,12 @@ load_single_split (GncSqlBackend* sql_be, GncSqlRow& row)
|
||||
qof_backend_set_error ((QofBackend*)sql_be, ERR_BACKEND_DATA_CORRUPT);
|
||||
pSplit = NULL;
|
||||
}
|
||||
if (!xaccSplitGetAccount(pSplit))
|
||||
{
|
||||
gchar guidstr[GUID_ENCODING_LENGTH + 1];
|
||||
guid_to_string_buff (qof_instance_get_guid (pSplit), guidstr);
|
||||
PERR("Split %s created with no account!", guidstr);
|
||||
}
|
||||
return pSplit;
|
||||
}
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user