Fixed potential bug when item doesn't have a payload

This commit is contained in:
Olivier Prat 2017-10-20 09:50:37 +02:00
parent 6acff216d9
commit 3227b9d64a

View file

@ -118,10 +118,11 @@ void MetaToSubItems::run(const RenderContextPointer& renderContext, const ItemBo
for (auto idBound : inItems) {
auto& item = scene->getItem(idBound.id);
if (item.exist()) {
item.fetchMetaSubItems(outItems);
}
}
}
void IDsToBounds::run(const RenderContextPointer& renderContext, const ItemIDs& inItems, ItemBounds& outItems) {
auto& scene = renderContext->_scene;
@ -132,9 +133,10 @@ void IDsToBounds::run(const RenderContextPointer& renderContext, const ItemIDs&
if (!_disableAABBs) {
for (auto id : inItems) {
auto& item = scene->getItem(id);
if (item.exist()) {
outItems.emplace_back(ItemBound{ id, item.getBound() });
}
}
} else {
for (auto id : inItems) {
outItems.emplace_back(ItemBound{ id });