[ntcore] Correctly start DataLog for existing publishers (#5703)

This commit is contained in:
Peter Johnson
2023-10-01 06:43:18 -07:00
committed by GitHub
parent 5e295dfbda
commit aecbcb08fc

View File

@@ -1450,13 +1450,12 @@ NT_DataLogger LocalStorage::StartDataLog(wpi::log::DataLog& log,
}
topic->datalogs.emplace_back(log, datalogger->Start(topic.get(), now),
datalogger->handle);
topic->datalogType = topic->type;
// log current value, if any
if (!topic->lastValue) {
continue;
if (topic->lastValue) {
topic->datalogs.back().Append(topic->lastValue);
}
topic->datalogType = topic->type;
topic->datalogs.back().Append(topic->lastValue);
}
return datalogger->handle;