summaryrefslogtreecommitdiff
path: root/src/convert.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/convert.cc')
-rw-r--r--src/convert.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/convert.cc b/src/convert.cc
index d7ee52b7..5d3f23fa 100644
--- a/src/convert.cc
+++ b/src/convert.cc
@@ -97,18 +97,20 @@ value_t convert_command(call_scope_t& args)
}
bool matched = false;
- post_map_t::iterator i = post_map.find(- xact->posts.front()->amount);
- if (i != post_map.end()) {
- std::list<post_t *>& post_list((*i).second);
- foreach (post_t * post, post_list) {
- if (xact->code && post->xact->code &&
- *xact->code == *post->xact->code) {
- matched = true;
- break;
- }
- else if (xact->actual_date() == post->actual_date()) {
- matched = true;
- break;
+ if (! xact->posts.front()->amount.is_null()) {
+ post_map_t::iterator i = post_map.find(- xact->posts.front()->amount);
+ if (i != post_map.end()) {
+ std::list<post_t *>& post_list((*i).second);
+ foreach (post_t * post, post_list) {
+ if (xact->code && post->xact->code &&
+ *xact->code == *post->xact->code) {
+ matched = true;
+ break;
+ }
+ else if (xact->actual_date() == post->actual_date()) {
+ matched = true;
+ break;
+ }
}
}
}