Handle unopened data writers for ran_out_of_space and friends
We used to crash when writers weren't open. Instead ignore them.
Change-Id: I24176837d350bd0aa2a5c750222bbb4749b83b26
diff --git a/aos/events/logging/log_namer.cc b/aos/events/logging/log_namer.cc
index a73be9b..2d1e111 100644
--- a/aos/events/logging/log_namer.cc
+++ b/aos/events/logging/log_namer.cc
@@ -251,6 +251,7 @@
void MultiNodeLogNamer::ResetStatistics() {
for (std::pair<const Channel *const, DataWriter> &data_writer :
data_writers_) {
+ if (!data_writer.second.writer) continue;
data_writer.second.writer->ResetStatistics();
}
if (data_writer_.writer) {