Return nullptr in case of invalid numeric field to allow proper error handling

This commit is contained in:
Geert Janssens 2016-09-15 10:23:11 +02:00 committed by Geert Janssens
parent e0caec0e22
commit c1d798d0b0

View File

@ -396,7 +396,7 @@ static gnc_numeric* convert_amount_col_str (const std::string &str, int currency
{
/* If a cell is empty or just spaces return 0 as amount */
if(!boost::regex_search(str, boost::regex("[0-9]")))
return new gnc_numeric({0, 0});
return nullptr;
auto expr = boost::make_u32regex("[[:Sc:]]");
std::string str_no_symbols = boost::u32regex_replace(str, expr, "");