summaryrefslogtreecommitdiff
path: root/derive.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-02-15 20:35:45 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:21 -0400
commitca9ea27081292ed335bfe742d417d5a25bb5c867 (patch)
treefe2e83e8e58ac83f01f26765977b4279bf943e14 /derive.cc
parenta8012940f4d15a2e1d8fbdac02a631dae6231b1e (diff)
downloadfork-ledger-ca9ea27081292ed335bfe742d417d5a25bb5c867.tar.gz
fork-ledger-ca9ea27081292ed335bfe742d417d5a25bb5c867.tar.bz2
fork-ledger-ca9ea27081292ed335bfe742d417d5a25bb5c867.zip
(derive_new_entry): Added an error check if only a payee is specified
for "entry" but the payee wasn't found. (This came from the mailing list, thanks guys).
Diffstat (limited to 'derive.cc')
-rw-r--r--derive.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/derive.cc b/derive.cc
index 41a01370..1c8964b5 100644
--- a/derive.cc
+++ b/derive.cc
@@ -34,6 +34,9 @@ entry_t * derive_new_entry(journal_t& journal,
added->payee = matching ? matching->payee : regexp.pattern;
if (i == end) {
+ if (! matching)
+ throw error("Could not find a matching payee");
+
// If no argument were given but the payee, assume the user wants
// to see the same transaction as last time.
added->code = matching->code;