(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).
This commit is contained in:
parent
a8012940f4
commit
ca9ea27081
1 changed files with 3 additions and 0 deletions
|
|
@ -34,6 +34,9 @@ entry_t * derive_new_entry(journal_t& journal,
|
||||||
added->payee = matching ? matching->payee : regexp.pattern;
|
added->payee = matching ? matching->payee : regexp.pattern;
|
||||||
|
|
||||||
if (i == end) {
|
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
|
// If no argument were given but the payee, assume the user wants
|
||||||
// to see the same transaction as last time.
|
// to see the same transaction as last time.
|
||||||
added->code = matching->code;
|
added->code = matching->code;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue