diff options
author | thickbrick | 2011-04-05 23:16:20 +0300 |
---|---|---|
committer | thickbrick | 2011-04-05 23:16:20 +0300 |
commit | 5c9c5ecd774dc31c9b0afd64b63d574b698cc428 (patch) | |
tree | b1690f8b84a0fde9fb672f6c0d946f587b73dd21 | |
parent | Fix #846: Crash when double-clicking system tree (diff) | |
download | meta-impy-5c9c5ecd774dc31c9b0afd64b63d574b698cc428.zip meta-impy-5c9c5ecd774dc31c9b0afd64b63d574b698cc428.tar.gz meta-impy-5c9c5ecd774dc31c9b0afd64b63d574b698cc428.tar.bz2 meta-impy-5c9c5ecd774dc31c9b0afd64b63d574b698cc428.tar.xz |
Fix #851: Crash in LLViewerObject::getBoundingBoxAgent
Add some null guards, taken from Snowglobe 2.
-rw-r--r-- | linden/indra/newview/llviewerobject.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp index 65c1d11..9d69be5 100644 --- a/linden/indra/newview/llviewerobject.cpp +++ b/linden/indra/newview/llviewerobject.cpp | |||
@@ -4012,9 +4012,15 @@ LLBBox LLViewerObject::getBoundingBoxAgent() const | |||
4012 | { | 4012 | { |
4013 | LLVector3 position_agent; | 4013 | LLVector3 position_agent; |
4014 | LLQuaternion rot; | 4014 | LLQuaternion rot; |
4015 | LLViewerObject* avatar_parent = NULL; | ||
4015 | LLViewerObject* root_edit = (LLViewerObject*)getRootEdit(); | 4016 | LLViewerObject* root_edit = (LLViewerObject*)getRootEdit(); |
4016 | LLViewerObject* avatar_parent = (LLViewerObject*)root_edit->getParent(); | 4017 | if (root_edit) |
4017 | if (avatar_parent && avatar_parent->isAvatar() && root_edit->mDrawable.notNull()) | 4018 | { |
4019 | avatar_parent = (LLViewerObject*)root_edit->getParent(); | ||
4020 | } | ||
4021 | |||
4022 | if (avatar_parent && avatar_parent->isAvatar() && | ||
4023 | root_edit && root_edit->mDrawable.notNull() && root_edit->mDrawable->getXform()->getParent()) | ||
4018 | { | 4024 | { |
4019 | LLXform* parent_xform = root_edit->mDrawable->getXform()->getParent(); | 4025 | LLXform* parent_xform = root_edit->mDrawable->getXform()->getParent(); |
4020 | position_agent = (getPositionEdit() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); | 4026 | position_agent = (getPositionEdit() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); |