1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

Avoid null pointer dereference

This commit is contained in:
Andrei Kortunov 2019-11-13 14:50:42 +04:00
parent af41e9acc1
commit ca2a524a5f

View File

@ -539,7 +539,7 @@ std::string NpcAnimation::getShieldMesh(MWWorld::ConstPtr shield) const
{
const ESM::BodyPart *bodypart = 0;
bodypart = partStore.search(bodypartName);
if (bodypart->mData.mType != ESM::BodyPart::MT_Armor)
if (bodypart == nullptr || bodypart->mData.mType != ESM::BodyPart::MT_Armor)
return "";
else if (!bodypart->mModel.empty())
mesh = "meshes\\" + bodypart->mModel;