mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 23:36:44 +02:00
Add an extra sanity check when calling fetchMetaSubItems when the subItems is not allocated yet
This commit is contained in:
parent
d59a721f16
commit
2ee0af03c8
1 changed files with 9 additions and 3 deletions
|
@ -118,9 +118,15 @@ uint32_t Item::fetchMetaSubItemBounds(ItemBounds& subItemBounds, Scene& scene) c
|
||||||
auto numSubs = fetchMetaSubItems(subItems);
|
auto numSubs = fetchMetaSubItems(subItems);
|
||||||
|
|
||||||
for (auto id : subItems) {
|
for (auto id : subItems) {
|
||||||
auto& item = scene.getItem(id);
|
// TODO: Adding an extra check here even thought we shouldn't have too.
|
||||||
if (item.exist()) {
|
// We have cases when the id returned by fetchMetaSubItems is not allocated
|
||||||
subItemBounds.emplace_back(id, item.getBound());
|
if (scene.isAllocatedID(id)) {
|
||||||
|
auto& item = scene.getItem(id);
|
||||||
|
if (item.exist()) {
|
||||||
|
subItemBounds.emplace_back(id, item.getBound());
|
||||||
|
} else {
|
||||||
|
numSubs--;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
numSubs--;
|
numSubs--;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue