summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHecklezz <tj8@live.com.au>2025-11-13 01:48:03 +1000
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-11-13 09:33:59 +0200
commit516a3d0dae7117068175df925ec2216430350b76 (patch)
tree3b99171ed61d285d51f0895730749aaa731b2b5c
parentc39b35eaf15e384c3c0492bebd03b1a0130649a1 (diff)
Fix crash in handleHover accessing null parent
Signed-off-by: Hecklezz <tj8@live.com.au>
-rw-r--r--indra/newview/llmaniptranslate.cpp34
1 files changed, 19 insertions, 15 deletions
diff --git a/indra/newview/llmaniptranslate.cpp b/indra/newview/llmaniptranslate.cpp
index 0888f630e8..9bcfd9e2c0 100644
--- a/indra/newview/llmaniptranslate.cpp
+++ b/indra/newview/llmaniptranslate.cpp
@@ -695,24 +695,28 @@ bool LLManipTranslate::handleHover(S32 x, S32 y, MASK mask)
// handle attachments in local space
if (object->isAttachment() && object->mDrawable.notNull())
{
- // calculate local version of relative move
- LLQuaternion objWorldRotation = object->mDrawable->mXform.getParent()->getWorldRotation();
- objWorldRotation.transQuat();
+ LLXform* object_xform_parent = object->mDrawable->mXform.getParent();
+ if (object_xform_parent)
+ {
+ // calculate local version of relative move
+ LLQuaternion objWorldRotation = object_xform_parent->getWorldRotation();
+ objWorldRotation.transQuat();
- LLVector3 old_position_local = object->getPosition();
- LLVector3 new_position_local = selectNode->mSavedPositionLocal + (clamped_relative_move_f * objWorldRotation);
+ LLVector3 old_position_local = object->getPosition();
+ LLVector3 new_position_local = selectNode->mSavedPositionLocal + (clamped_relative_move_f * objWorldRotation);
- //RN: I forget, but we need to do this because of snapping which doesn't often result
- // in position changes even when the mouse moves
- object->setPosition(new_position_local);
- rebuild(object);
- gAgentAvatarp->clampAttachmentPositions();
- new_position_local = object->getPosition();
+ //RN: I forget, but we need to do this because of snapping which doesn't often result
+ // in position changes even when the mouse moves
+ object->setPosition(new_position_local);
+ rebuild(object);
+ gAgentAvatarp->clampAttachmentPositions();
+ new_position_local = object->getPosition();
- if (selectNode->mIndividualSelection)
- {
- // counter-translate child objects if we are moving the root as an individual
- object->resetChildrenPosition(old_position_local - new_position_local, true);
+ if (selectNode->mIndividualSelection)
+ {
+ // counter-translate child objects if we are moving the root as an individual
+ object->resetChildrenPosition(old_position_local - new_position_local, true);
+ }
}
}
else