Skip to content

Commit 714e668

Browse files
committed
Fixed crash when clearing the timer
1 parent 1bc241d commit 714e668

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/scheduler.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ uint32_t Scheduler::EventInstance::getDelay(int fromDay, uint32_t fromOffset)
147147

148148
uint32_t Scheduler::EventInstance::randomiseStartOffset()
149149
{
150+
if(!_event) {
151+
return 0;
152+
}
153+
150154
int32_t offset = _event->getOffset();
151155
if(_event->getState() == EvseState::Active) {
152156
offset += random(-min((int32_t)scheduler_start_window, offset), scheduler_start_window);

0 commit comments

Comments
 (0)