Fixed bug found by KroArtem where crashes occur if you specify an invalid gp name on the terminal

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9541 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-08-17 00:22:50 +00:00
parent 0821fe3728
commit 753ef5c351

View File

@ -626,6 +626,13 @@ int handleCmdLine(int argc, char **argv)
{
race_manager->setMajorMode(RaceManager::MAJOR_MODE_GRAND_PRIX);
const GrandPrixData *gp = grand_prix_manager->getGrandPrix(argv[i+1]);
if (gp == NULL)
{
fprintf(stderr, "There is no GP named '%s'\n", argv[i+1]);
return 0;
}
race_manager->setGrandPrix(*gp);
i++;
}