Skip to content

Commit

Permalink
#508 Ensure value writer is present.
Browse files Browse the repository at this point in the history
  • Loading branch information
eidekrist committed Jan 7, 2020
1 parent 0e4b643 commit 0646a5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cpp/observer/file_observer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ void file_observer::step_complete(step_number /*lastStep*/, duration /*lastStepS

void file_observer::simulator_step_complete(simulator_index index, step_number lastStep, duration /*lastStepSize*/, time_point currentTime)
{
if (recording_) {
valueWriters_.at(index)->observe(lastStep, currentTime);
if (auto writer = valueWriters_.find(index); writer != valueWriters_.end() && recording_) {
writer->second->observe(lastStep, currentTime);
}
}

Expand All @@ -347,7 +347,7 @@ void file_observer::start_recording()
void file_observer::stop_recording()
{
if (!recording_) {
throw std::runtime_error("File observer has already stopeed recording");
throw std::runtime_error("File observer has already stopped recording");
} else {
for (const auto& entry : valueWriters_) {
entry.second->stop_recording();
Expand Down

0 comments on commit 0646a5b

Please sign in to comment.