From 925b70d5c60849a2ca6857fcc5727f0d87d14757 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 22 May 2010 18:50:35 -0400 Subject: Ommitting args to the entry command print nothing --- src/draft.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/draft.cc') 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; } -- cgit v1.2.3