summaryrefslogtreecommitdiff
path: root/src/post.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-05 05:11:15 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-05 05:11:15 -0500
commit4464ed187b28f9b253431e2b0dde3cb0e875b4d8 (patch)
treebfa1196a6b938eb35e636e699bf4271c74e176ca /src/post.cc
parentab9fc6f9f0e74022d3ab09873a61450b8c0ccd82 (diff)
downloadfork-ledger-4464ed187b28f9b253431e2b0dde3cb0e875b4d8.tar.gz
fork-ledger-4464ed187b28f9b253431e2b0dde3cb0e875b4d8.tar.bz2
fork-ledger-4464ed187b28f9b253431e2b0dde3cb0e875b4d8.zip
If a posting's amount is null, return 0L
Diffstat (limited to 'src/post.cc')
-rw-r--r--src/post.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/post.cc b/src/post.cc
index d7923866..4f45592f 100644
--- a/src/post.cc
+++ b/src/post.cc
@@ -160,6 +160,8 @@ namespace {
value_t get_amount(post_t& post) {
if (post.has_xdata() && post.xdata().has_flags(POST_EXT_COMPOUND))
return post.xdata().compound_value;
+ else if (post.amount.is_null())
+ return 0L;
else
return post.amount;
}
@@ -186,6 +188,8 @@ namespace {
else if (post.has_xdata() &&
post.xdata().has_flags(POST_EXT_COMPOUND))
return post.xdata().compound_value;
+ else if (post.amount.is_null())
+ return 0L;
else
return post.amount;
}
@@ -193,6 +197,8 @@ namespace {
value_t get_total(post_t& post) {
if (post.xdata_ && ! post.xdata_->total.is_null())
return post.xdata_->total;
+ else if (post.amount.is_null())
+ return 0L;
else
return post.amount;
}