Avoid using null pointer in feature_unlocked.cpp

This commit is contained in:
Vincent Lejeune
2014-11-17 01:11:40 +01:00
parent 7935df5dec
commit 3cf3af57d8

View File

@@ -534,6 +534,7 @@ void FeatureUnlockedCutScene::addUnlockedTrack(const Track* track)
void FeatureUnlockedCutScene::addUnlockedGP(const GrandPrixData* gp)
{
std::vector<ITexture*> images;
core::stringw gpname;
if (gp == NULL)
{
Log::error("FeatureUnlockedCutScene::addUnlockedGP", "Unlocked GP does not exist");
@@ -560,9 +561,9 @@ void FeatureUnlockedCutScene::addUnlockedGP(const GrandPrixData* gp)
: file_manager->getAsset(FileManager::GUI,"main_help.png"));
images.push_back(tex);
}
gpname = gp->getName();
}
core::stringw gpname = gp->getName();
addUnlockedPictures(images, 4.0f, 3.0f, _("You unlocked grand prix %0", gpname));
}