summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-07-08 15:14:23 -0500
committerDave Parks <davep@lindenlab.com>2010-07-08 15:14:23 -0500
commit3d9413377638886ca2c6616f13be18beac00ebeb (patch)
tree4d1922210cbfe00ad17994d0f4726007c6e4aed2 /indra
parentb056f6d7f7f33542177cc2c118743e2a8950e925 (diff)
EXT-8287 Add some null checks and asserts around drawable faces.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lldrawable.h16
-rw-r--r--indra/newview/llface.h2
2 files changed, 15 insertions, 3 deletions
diff --git a/indra/newview/lldrawable.h b/indra/newview/lldrawable.h
index 651dabff9e..08972853c3 100644
--- a/indra/newview/lldrawable.h
+++ b/indra/newview/lldrawable.h
@@ -313,8 +313,20 @@ private:
inline LLFace* LLDrawable::getFace(const S32 i) const
{
- llassert((U32)i < mFaces.size());
- llassert(mFaces[i]);
+ //switch these asserts to llerrs -- davep
+ //llassert((U32)i < mFaces.size());
+ //llassert(mFaces[i]);
+
+ if ((U32) i >= mFaces.size())
+ {
+ llerrs << "Invalid face index." << llendl;
+ }
+
+ if (!mFaces[i])
+ {
+ llerrs << "Null face found." << llendl;
+ }
+
return mFaces[i];
}
diff --git a/indra/newview/llface.h b/indra/newview/llface.h
index 67dd97e6f7..de533a6864 100644
--- a/indra/newview/llface.h
+++ b/indra/newview/llface.h
@@ -279,7 +279,7 @@ public:
{
bool operator()(const LLFace* const& lhs, const LLFace* const& rhs)
{
- return lhs->mDistance > rhs->mDistance; // farthest = first
+ return !lhs || (rhs && (lhs->mDistance > rhs->mDistance)); // farthest = first
}
};