فهرست منبع

Merge pull request #1256 from Azaezel/alpha41/orphanOops

getPrefabByCHild should skip NULLs
Brian Roberts 1 سال پیش
والد
کامیت
848db69ef1
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  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;