Prevent crash if replaying empty log

This commit is contained in:
Daniel Öster 2025-03-02 19:50:06 +02:00
parent c77ead8dc3
commit 7869997dd9

View file

@ -56,10 +56,7 @@ void canReplayTask(void* param) {
std::vector<String> messages;
int lastIndex = 0;
if (importedLogs.length() == 0) {
return;
}
if (!(importedLogs.length() == 0)) {
// Split importedLogs into individual messages
while (true) {
int nextIndex = importedLogs.indexOf("\n", lastIndex);
@ -133,6 +130,7 @@ void canReplayTask(void* param) {
transmit_can_frame(&currentFrame, datalayer.system.info.can_replay_interface);
}
} while (datalayer.system.info.loop_playback);
}
vTaskDelete(NULL); // Delete task when done
}