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:
Peter Barker 2016-05-16 13:02:25 +10:00 committed by Lucas De Marchi
parent 27e7c870ed
commit 8d5ceda534
1 changed files with 4 additions and 0 deletions

View File

@ -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);