AP_HAL_SITL: ensure specified SITL model is found
Without this check we get a null pointer exception the first time we attempt to use the model object
This commit is contained in:
parent
27e7c870ed
commit
8d5ceda534
@ -248,6 +248,10 @@ void SITL_State::_parse_command_line(int argc, char * const argv[])
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sitl_model == nullptr) {
|
||||
printf("Vehicle model (%s) not found\n", model_str);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fprintf(stdout, "Starting sketch '%s'\n", SKETCH);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user