Check for null pointer.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1119 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2007-12-21 15:39:23 +00:00
parent fb26c88b28
commit 379b7570d7
1 changed files with 2 additions and 2 deletions

View File

@ -1259,7 +1259,7 @@ void CNullDriver::drawMeshBuffer(const scene::IMeshBuffer* mb)
CNullDriver::SHWBufferLink *CNullDriver::getBufferLink(const scene::IMeshBuffer* mb)
{
if (!isHardwareBufferRecommend(mb))
if (!mb || !isHardwareBufferRecommend(mb))
return 0;
//search for hardware links
@ -1325,7 +1325,7 @@ void CNullDriver::removeAllHardwareBuffers()
bool CNullDriver::isHardwareBufferRecommend(const scene::IMeshBuffer* mb)
{
if (mb->getHardwareMappingHint()==scene::EHM_NEVER)
if (!mb || mb->getHardwareMappingHint()==scene::EHM_NEVER)
return false;
if (mb->getVertexCount()<500) //todo: tweak and make user definable