mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-20 11:48:30 -06:00
Csv Trans Imp - remove redundant test
Remainder of the code ensures a GncPreSplit account is always set to either the base account value or a value of an account column. It's useless to try once more to set a base account right before creating the preliminary transactions.
This commit is contained in:
parent
3af9374126
commit
88fd034f89
@ -636,18 +636,13 @@ void GncTxImport::create_transaction (std::vector<parse_line_t>::iterator& parse
|
||||
auto line_acct = split_props->get_account();
|
||||
if (!line_acct)
|
||||
{
|
||||
if (m_settings.m_base_account)
|
||||
split_props->set_account(m_settings.m_base_account);
|
||||
else
|
||||
{
|
||||
// Oops - the user didn't select an Account column *and* we didn't get a default value either!
|
||||
// Note if you get here this suggests a bug in the code!
|
||||
auto error_message = _("No account column selected and no base account specified either.\n"
|
||||
"This should never happen. Please report this as a bug.");
|
||||
PINFO("User warning: %s", error_message);
|
||||
auto errs = ErrMap { ErrPair { GncTransPropType::NONE, error_message},};
|
||||
throw GncCsvImpParseError(_("Parse Error"), errs);
|
||||
}
|
||||
// Oops - the user didn't select an Account column *and* we didn't get a default value either!
|
||||
// Note if you get here this suggests a bug in the code!
|
||||
auto error_message = _("No account column selected and no base account specified either.\n"
|
||||
"This should never happen. Please report this as a bug.");
|
||||
PINFO("User warning: %s", error_message);
|
||||
auto errs = ErrMap { ErrPair { GncTransPropType::NONE, error_message},};
|
||||
throw GncCsvImpParseError(_("Parse Error"), errs);
|
||||
}
|
||||
|
||||
/* If column parsing was successful, convert trans properties into a draft transaction. */
|
||||
|
Loading…
Reference in New Issue
Block a user