diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index abbbb2cbfdba5f499d22c3ee79baf3999b9bd346..7bc33a6ede774196542898611be4afddfecf80e5 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1335,7 +1335,7 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi
 						LLTextureEntry *te = obj->getTE(object_face);
 
 						// can modify URL if we can modify the object or we have navigate permissions
-						bool allow_modify_url = obj->permModify() || obj->hasMediaPermission( te->getMediaData(), LLVOVolume::MEDIA_PERM_INTERACT );
+						bool allow_modify_url = obj->permModify() || (te && obj->hasMediaPermission( te->getMediaData(), LLVOVolume::MEDIA_PERM_INTERACT ));
 
 						if (te && allow_modify_url )
 						{
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 838a05472c2d4e013895bfc3fb715e27f2134890..94f07fb346aaebfe8fef457c8322ea1cc11a8a87 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1455,7 +1455,7 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax)
         {
             LLViewerJointAttachment* attachment = attach_pair.second;
 
-            if (attachment->getValid())
+            if (attachment && attachment->getValid())
             {
                 for (LLViewerObject* attached_object : attachment->mAttachedObjects)
                 {
@@ -1885,7 +1885,7 @@ BOOL LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a&
 			for (const auto& attach_pair : mAttachmentPoints)
 			{
 				LLViewerJointAttachment* attachment = attach_pair.second;
-
+				if (!attachment) continue;
 				for (LLViewerObject* attached_object : attachment->mAttachedObjects)
 				{
 					if (attached_object && !attached_object->isDead() && attachment->getValid())
@@ -1943,6 +1943,7 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector
 		for (const auto& attach_pair : mAttachmentPoints)
 		{
 			LLViewerJointAttachment* attachment = attach_pair.second;
+			if (!attachment) continue;
 
 			for (LLViewerObject* attached_object : attachment->mAttachedObjects)
 			{
@@ -2256,7 +2257,7 @@ void LLVOAvatar::releaseMeshData()
 	for (const auto& attach_pair : mAttachmentPoints)
 	{
 		LLViewerJointAttachment* attachment = attach_pair.second;
-		if (!attachment->getIsHUDAttachment())
+		if (attachment && !attachment->getIsHUDAttachment())
 		{
 			attachment->setAttachmentVisibility(FALSE);
 		}
@@ -2870,6 +2871,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
 		for (const auto& attach_point_pair : mAttachmentPoints)
 		{
 			LLViewerJointAttachment* attachment = attach_point_pair.second;
+			if (!attachment) continue;
 
 			for (LLViewerObject* attached_object : attachment->mAttachedObjects)
 			{
@@ -2883,7 +2885,7 @@ void LLVOAvatar::idleUpdateMisc(bool detailed_update)
 
                 LLSpatialBridge* bridge = attached_object->mDrawable->getSpatialBridge();
 				
-				if (visible || !(bridge && bridge->getRadius() < 2.0))
+				if (visible || !(bridge && bridge->getRadius() < 2.0f))
 				{
                     //override rigged attachments' octree spatial extents with this avatar's bounding box
                     bool rigged = false;
@@ -7761,7 +7763,7 @@ void LLVOAvatar::resetHUDAttachments()
 	for (const auto& attach_pair : mAttachmentPoints)
 	{
 		LLViewerJointAttachment* attachment = attach_pair.second;
-		if (attachment->getIsHUDAttachment())
+		if (attachment && attachment->getIsHUDAttachment())
 		{
 			for (const LLViewerObject* attached_object : attachment->mAttachedObjects)
 			{
@@ -7779,6 +7781,8 @@ void LLVOAvatar::rebuildRiggedAttachments( void )
 	for (const auto& attach_pair : mAttachmentPoints)
 	{
 		LLViewerJointAttachment* pAttachment = attach_pair.second;
+		if (!pAttachment) continue;
+
 		for (const LLViewerObject* pAttachedObject : pAttachment->mAttachedObjects)
 		{
 			if (pAttachedObject && pAttachedObject->mDrawable.notNull() )