summaryrefslogtreecommitdiff
path: root/src/draft.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-05-22 18:50:35 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-05-22 21:35:03 -0400
commit925b70d5c60849a2ca6857fcc5727f0d87d14757 (patch)
tree5c66cd2e19ed3760d98624f64fd98566472552a0 /src/draft.cc
parenta3482606dc33b88d2ae661e49c6b15b902497421 (diff)
downloadfork-ledger-925b70d5c60849a2ca6857fcc5727f0d87d14757.tar.gz
fork-ledger-925b70d5c60849a2ca6857fcc5727f0d87d14757.tar.bz2
fork-ledger-925b70d5c60849a2ca6857fcc5727f0d87d14757.zip
Ommitting args to the entry command print nothing
Diffstat (limited to 'src/draft.cc')
-rw-r--r--src/draft.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/draft.cc b/src/draft.cc
index 18075731..69dc7025 100644
--- a/src/draft.cc
+++ b/src/draft.cc
@@ -240,6 +240,9 @@ void draft_t::parse_args(const value_t& args)
xact_t * draft_t::insert(journal_t& journal)
{
+ if (! tmpl)
+ return NULL;
+
if (tmpl->payee_mask.empty())
throw std::runtime_error(_("'xact' command requires at least a payee"));
@@ -528,7 +531,8 @@ value_t xact_command(call_scope_t& args)
// Only consider actual postings for the "xact" command
report.HANDLER(limit_).on(string("#xact"), "actual");
- report.xact_report(post_handler_ptr(new print_xacts(report)), *new_xact);
+ if (new_xact)
+ report.xact_report(post_handler_ptr(new print_xacts(report)), *new_xact);
return true;
}