From cdf348df248ea9fc23bb8f1ccf55b71c1821e0f5 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Fri, 28 Jun 2019 14:06:35 +0100 Subject: [PATCH] Check for a blank line on the transaction importer If you have some blank lines, just newlines at the end of file and you have an account column and do not remove them you will get an error advising that there is no account column selected or account specified so this change removes them from being parsed. --- gnucash/import-export/csv-imp/gnc-import-tx.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gnucash/import-export/csv-imp/gnc-import-tx.cpp b/gnucash/import-export/csv-imp/gnc-import-tx.cpp index 34d68b7632..99536136b9 100644 --- a/gnucash/import-export/csv-imp/gnc-import-tx.cpp +++ b/gnucash/import-export/csv-imp/gnc-import-tx.cpp @@ -392,11 +392,12 @@ void GncTxImport::tokenize (bool guessColTypes) m_parsed_lines.clear(); for (auto tokenized_line : m_tokenizer->get_tokens()) { - m_parsed_lines.push_back (std::make_tuple (tokenized_line, std::string(), - std::make_shared(date_format()), - std::make_shared(date_format(), currency_format()), - false)); auto length = tokenized_line.size(); + if (length > 0) + m_parsed_lines.push_back (std::make_tuple (tokenized_line, std::string(), + std::make_shared(date_format()), + std::make_shared(date_format(), currency_format()), + false)); if (length > max_cols) max_cols = length; }