SIBImporter: Add assertions to silence static analyzer warnings

pull/1498/head
Turo Lamminen 2017-11-14 19:08:41 +02:00
parent 583d3f88b8
commit e47bf932e8
1 changed files with 2 additions and 0 deletions

View File

@ -902,6 +902,7 @@ void SIBImporter::InternReadFile(const std::string& pFile,
// Add nodes for each object. // Add nodes for each object.
for (size_t n=0;n<sib.objs.size();n++) for (size_t n=0;n<sib.objs.size();n++)
{ {
ai_assert(root->mChildren);
SIBObject& obj = sib.objs[n]; SIBObject& obj = sib.objs[n];
aiNode* node = new aiNode; aiNode* node = new aiNode;
root->mChildren[childIdx++] = node; root->mChildren[childIdx++] = node;
@ -926,6 +927,7 @@ void SIBImporter::InternReadFile(const std::string& pFile,
// (no transformation as the light is already in world space) // (no transformation as the light is already in world space)
for (size_t n=0;n<sib.lights.size();n++) for (size_t n=0;n<sib.lights.size();n++)
{ {
ai_assert(root->mChildren);
aiLight* light = sib.lights[n]; aiLight* light = sib.lights[n];
if ( nullptr != light ) { if ( nullptr != light ) {
aiNode* node = new aiNode; aiNode* node = new aiNode;