summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2023-12-12 00:39:59 +0200
committerakleshchev <117672381+akleshchev@users.noreply.github.com>2023-12-12 14:46:07 +0200
commit67ee70a6abe1e1b8ae1cc8e89e404357495fb313 (patch)
tree6159211b0552e4a8718d14b01490aff8bca754f8 /indra
parent7e6578dc0f71fa969d6b301fd3d3ef4090d68d50 (diff)
SL-20713 Crash at isAvatar
Likely object was NULL
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llselectmgr.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index d172a87b1d..f0d3e878dd 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -4308,9 +4308,12 @@ BOOL LLSelectMgr::selectGetAggregateTexturePermissions(LLAggregatePermissions& r
BOOL LLSelectMgr::isMovableAvatarSelected()
{
- if (mAllowSelectAvatar)
+ if (mAllowSelectAvatar && getSelection()->getObjectCount() == 1)
{
- return (getSelection()->getObjectCount() == 1) && (getSelection()->getFirstRootObject()->isAvatar()) && getSelection()->getFirstMoveableNode(TRUE);
+ // nothing but avatar should be selected, so check that
+ // there is only one selected object and it is a root
+ LLViewerObject* obj = getSelection()->getFirstRootObject();
+ return obj && obj->isAvatar() && getSelection()->getFirstMoveableNode(TRUE);
}
return FALSE;
}