mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-04 18:29:48 +02:00
Prevent crash if replaying empty log
This commit is contained in:
parent
c77ead8dc3
commit
7869997dd9
1 changed files with 73 additions and 75 deletions
|
@ -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(¤tFrame, datalayer.system.info.can_replay_interface);
|
||||
}
|
||||
} while (datalayer.system.info.loop_playback);
|
||||
}
|
||||
|
||||
vTaskDelete(NULL); // Delete task when done
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue