Made "convert" command insensitive to null amounts

This commit is contained in:
John Wiegley 2010-06-18 07:27:18 -04:00
parent 5da1e7756d
commit 6f73a4db0c

View file

@ -97,18 +97,20 @@ value_t convert_command(call_scope_t& args)
} }
bool matched = false; bool matched = false;
post_map_t::iterator i = post_map.find(- xact->posts.front()->amount); if (! xact->posts.front()->amount.is_null()) {
if (i != post_map.end()) { post_map_t::iterator i = post_map.find(- xact->posts.front()->amount);
std::list<post_t *>& post_list((*i).second); if (i != post_map.end()) {
foreach (post_t * post, post_list) { std::list<post_t *>& post_list((*i).second);
if (xact->code && post->xact->code && foreach (post_t * post, post_list) {
*xact->code == *post->xact->code) { if (xact->code && post->xact->code &&
matched = true; *xact->code == *post->xact->code) {
break; matched = true;
} break;
else if (xact->actual_date() == post->actual_date()) { }
matched = true; else if (xact->actual_date() == post->actual_date()) {
break; matched = true;
break;
}
} }
} }
} }