diff --git a/indra/newview/llsculptidsize.cpp b/indra/newview/llsculptidsize.cpp
index 9edd78bff03b33c14cf6acc425aeaeb8f5f20559..96dc279b7b531f35e3c3163c58b4a3b5b0b9cbbc 100644
--- a/indra/newview/llsculptidsize.cpp
+++ b/indra/newview/llsculptidsize.cpp
@@ -50,10 +50,9 @@ void LLSculptIDSize::inc(const LLDrawable *pdrawable, int sz)
 
 	if (!pdrawable) return;
 	LLVOVolume* vvol = pdrawable->getVOVolume();
-	if (!vvol) return;
-	if (!vvol->isAttachment()) return;
-	if (!vvol->getAvatar()) return;
-	if (vvol->getAvatar()->isSelf()) return;
+	if (!vvol || !vvol->isAttachment()) return;
+	LLVOAvatar* vavatar = vvol->getAvatar();
+	if (!vavatar || vavatar->isSelf()) return;
 	LLVolume *vol = vvol->getVolume();
 	if (!vol) return;
 
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 1563fe630de43f7a0551ee19a0f04bbc0be21b2d..0dec80c150475c4afe1338c4db823c26b3823cd3 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1191,13 +1191,15 @@ void LLVOVolume::notifyMeshLoaded()
 	mSculptChanged = TRUE;
 	gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_GEOMETRY, TRUE);
 
-    if (getAvatar() && !isAnimatedObject())
+	LLVOAvatar* rigged_avatar = getAvatar();
+    if (rigged_avatar && !isAnimatedObject())
     {
-        getAvatar()->addAttachmentOverridesForObject(this);
+		rigged_avatar->addAttachmentOverridesForObject(this);
     }
-    if (getControlAvatar() && isAnimatedObject())
+	LLControlAvatar* control_avatar = getControlAvatar();
+    if (control_avatar && isAnimatedObject())
     {
-        getControlAvatar()->addAttachmentOverridesForObject(this);
+		control_avatar->addAttachmentOverridesForObject(this);
     }
     updateVisualComplexity();
 }