Explorar o código

getPrefabByCHild should skip NULLs

AzaezelX hai 1 ano
pai
achega
785872d398
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      Engine/source/T3D/prefab.cpp

+ 2 - 0
Engine/source/T3D/prefab.cpp

@@ -460,6 +460,8 @@ void Prefab::_onFileChanged( const Torque::Path &path )
 
 Prefab* Prefab::getPrefabByChild( SimObject *child )
 {
+   if (child == NULL) return NULL;
+
    ChildToPrefabMap::Iterator itr = smChildToPrefabMap.find( child->getId() );
    if ( itr == smChildToPrefabMap.end() )
       return NULL;