Do not crash when cloning components without attributes.

This commit is contained in:
Amadeus 2014-02-20 10:43:53 +01:00
parent af11693a35
commit cfd3cdc048

View File

@ -1475,11 +1475,14 @@ Node* Node::CloneRecursive(Node* parent, SceneResolver& resolver, CreateMode mod
resolver.AddComponent(component->GetID(), cloneComponent);
const Vector<AttributeInfo>* compAttributes = component->GetAttributes();
for (unsigned j = 0; j < compAttributes->Size(); ++j)
if (compAttributes)
{
const AttributeInfo& attr = compAttributes->At(j);
if (attr.mode_ & AM_FILE)
cloneComponent->SetAttribute(j, component->GetAttribute(j));
for (unsigned j = 0; j < compAttributes->Size(); ++j)
{
const AttributeInfo& attr = compAttributes->At(j);
if (attr.mode_ & AM_FILE)
cloneComponent->SetAttribute(j, component->GetAttribute(j));
}
}
}