summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-15 02:50:07 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-15 02:50:07 -0400
commit78c44b5e795a98baacfbc56943b784370956cbca (patch)
treeeca86147cdfa5f8000b41c0603d7ff9b45219115
parentb10ff955a370b7fd2add5c5493f1987b5d7b6600 (diff)
downloadfork-ledger-78c44b5e795a98baacfbc56943b784370956cbca.tar.gz
fork-ledger-78c44b5e795a98baacfbc56943b784370956cbca.tar.bz2
fork-ledger-78c44b5e795a98baacfbc56943b784370956cbca.zip
bug fix
-rw-r--r--ledger.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/ledger.cc b/ledger.cc
index 3a58fce5..abfaca3c 100644
--- a/ledger.cc
+++ b/ledger.cc
@@ -111,7 +111,7 @@ entry_t * journal_t::derive_entry(strings_list::iterator i,
- first->amount, - first->amount);
added->add_transaction(xact);
- if (std::string(*i++) == "-from" && i != end)
+ if (i != end && std::string(*i++) == "-from" && i != end)
if (account_t * acct = find_account(*i))
added->transactions.back()->account = acct;
} else {
@@ -157,7 +157,7 @@ entry_t * journal_t::derive_entry(strings_list::iterator i,
added->add_transaction(xact);
}
- if (std::string(*i++) == "-from" && i != end) {
+ if (i != end && std::string(*i++) == "-from" && i != end) {
if (account_t * acct = find_account(*i++)) {
transaction_t * xact = new transaction_t(NULL, acct);
added->add_transaction(xact);