summaryrefslogtreecommitdiff
path: root/src/timelog.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/timelog.cc')
-rw-r--r--src/timelog.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/timelog.cc b/src/timelog.cc
index 31c8e6da..b22b2e60 100644
--- a/src/timelog.cc
+++ b/src/timelog.cc
@@ -126,10 +126,12 @@ void time_log_t::clock_in(const datetime_t& checkin,
{
time_entry_t event(checkin, account, desc);
- if (! time_entries.empty())
- foreach (time_entry_t& time_entry, time_entries)
+ if (! time_entries.empty()) {
+ foreach (time_entry_t& time_entry, time_entries) {
if (event.account == time_entry.account)
throw parse_error("Cannot double check-in to the same account");
+ }
+ }
time_entries.push_back(event);
}