VideoTexture: fix NULL pointer crash when material name is not found.

This commit is contained in:
Benoit Bolsee 2008-11-01 20:18:15 +00:00
parent b24c6ef70d
commit e72d6c7bfa

@ -96,7 +96,7 @@ RAS_IPolyMaterial * getMaterial (PyObject *obj, short matID)
// get material from mesh
RAS_MeshObject * mesh = gameObj->GetMesh(0);
RAS_MeshMaterial *meshMat = mesh->GetMeshMaterial(matID);
if (meshMat->m_bucket != NULL)
if (meshMat != NULL && meshMat->m_bucket != NULL)
// return pointer to polygon or blender material
return meshMat->m_bucket->GetPolyMaterial();
}