From e72d6c7bfaee29c0a1c360237299484ca5caaeb7 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Sat, 1 Nov 2008 20:18:15 +0000 Subject: [PATCH] VideoTexture: fix NULL pointer crash when material name is not found. --- source/gameengine/VideoTexture/Texture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp index 243c5f31db0..ea3f60b2775 100644 --- a/source/gameengine/VideoTexture/Texture.cpp +++ b/source/gameengine/VideoTexture/Texture.cpp @@ -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(); }