AP_HAL_SITL: fix segv in examples

This commit is contained in:
Mark Whitehorn 2020-09-09 17:12:56 -06:00 committed by Peter Barker
parent 995cda6363
commit 866405c7df
1 changed files with 4 additions and 2 deletions

View File

@ -429,8 +429,10 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
exit(1);
}
// Set SITL start time.
AP::sitl()->start_time_UTC = start_time_UTC;
if (AP::sitl()) {
// Set SITL start time.
AP::sitl()->start_time_UTC = start_time_UTC;
}
fprintf(stdout, "Starting sketch '%s'\n", SKETCH);