Skip to content
Snippets Groups Projects
Commit 05752ddb authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix crash????

parent 5f764e38
No related branches found
No related tags found
No related merge requests found
...@@ -212,15 +212,11 @@ void LLDerenderList::save() const ...@@ -212,15 +212,11 @@ void LLDerenderList::save() const
LLDerenderList::entry_list_t::iterator LLDerenderList::findEntry(LLDerenderEntry::EEntryType eType, const LLUUID& idEntry) LLDerenderList::entry_list_t::iterator LLDerenderList::findEntry(LLDerenderEntry::EEntryType eType, const LLUUID& idEntry)
{ {
if (m_Entries.empty()) return {};
return std::find_if(m_Entries.begin(), m_Entries.end(), [eType, &idEntry](const auto& e) { return (eType == e->getType()) && (idEntry == e->getID()); }); return std::find_if(m_Entries.begin(), m_Entries.end(), [eType, &idEntry](const auto& e) { return (eType == e->getType()) && (idEntry == e->getID()); });
} }
LLDerenderList::entry_list_t::iterator LLDerenderList::findObjectEntry(U64 idRegion, const LLUUID& idObject, U32 idRootLocal) LLDerenderList::entry_list_t::iterator LLDerenderList::findObjectEntry(U64 idRegion, const LLUUID& idObject, U32 idRootLocal)
{ {
if (m_Entries.empty()) return {};
// NOTE: 'idRootLocal' will be 0 for the root prim itself and is the only time we need to compare against 'idObject' // NOTE: 'idRootLocal' will be 0 for the root prim itself and is the only time we need to compare against 'idObject'
return std::find_if(m_Entries.begin(), m_Entries.end(), return std::find_if(m_Entries.begin(), m_Entries.end(),
[&idRegion, &idObject, &idRootLocal](const std::unique_ptr<LLDerenderEntry>& e) [&idRegion, &idObject, &idRootLocal](const std::unique_ptr<LLDerenderEntry>& e)
...@@ -365,14 +361,16 @@ bool LLDerenderList::canAddSelection() ...@@ -365,14 +361,16 @@ bool LLDerenderList::canAddSelection()
LLDerenderObject* LLDerenderList::getObjectEntry(const LLUUID& idObject) /*const*/ LLDerenderObject* LLDerenderList::getObjectEntry(const LLUUID& idObject) /*const*/
{ {
if (m_Entries.empty()) return nullptr;
LLDerenderList::entry_list_t::iterator itEntry = findEntry(LLDerenderEntry::TYPE_OBJECT, idObject); LLDerenderList::entry_list_t::iterator itEntry = findEntry(LLDerenderEntry::TYPE_OBJECT, idObject);
return (m_Entries.end() != itEntry) ? (LLDerenderObject*)itEntry->get() : NULL; return (m_Entries.end() != itEntry) ? (LLDerenderObject*)itEntry->get() : nullptr;
} }
LLDerenderObject* LLDerenderList::getObjectEntry(U64 idRegion, const LLUUID& idObject, U32 idRootLocal) /*const*/ LLDerenderObject* LLDerenderList::getObjectEntry(U64 idRegion, const LLUUID& idObject, U32 idRootLocal) /*const*/
{ {
if (m_Entries.empty()) return nullptr;
LLDerenderList::entry_list_t::const_iterator itEntry = findObjectEntry(idRegion, idObject, idRootLocal); LLDerenderList::entry_list_t::const_iterator itEntry = findObjectEntry(idRegion, idObject, idRootLocal);
return (m_Entries.end() != itEntry) ? (LLDerenderObject*)itEntry->get() : NULL; return (m_Entries.end() != itEntry) ? (LLDerenderObject*)itEntry->get() : nullptr;
} }
bool LLDerenderList::processObjectUpdate(U64 idRegion, const LLUUID& idObject, const LLVOCacheEntry* pCacheEntry) bool LLDerenderList::processObjectUpdate(U64 idRegion, const LLUUID& idObject, const LLVOCacheEntry* pCacheEntry)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment