diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index fede9a792fcddf52f6bfdf87681c5162573fb874..dc54346d59ca35618d863d244160b777f93f2caf 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -478,15 +478,25 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
 			{
 				U32 flags = 0;
 				mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i);
-                
-				if(flags & FLAGS_TEMPORARY_ON_REZ)
+
+				compressed_dp.unpackUUID(fullid, "ID");
+				compressed_dp.unpackU32(local_id, "LocalID");
+				compressed_dp.unpackU8(pcode, "PCode");
+				
+				if (pcode == 0)
 				{
-                    compressed_dp.unpackUUID(fullid, "ID");
-                    compressed_dp.unpackU32(local_id, "LocalID");
-                    compressed_dp.unpackU8(pcode, "PCode");
-                }
-				else //send to object cache
+					// object creation will fail, LLViewerObject::createObject()
+					LL_WARNS() << "Received object " << fullid
+						<< " with 0 PCode. Local id: " << local_id
+						<< " Flags: " << flags
+						<< " Region: " << regionp->getName()
+						<< " Region id: " << regionp->getRegionID() << LL_ENDL;
+					recorder.objectUpdateFailure(local_id, update_type, msg_size);
+					continue;
+				}
+				else if ((flags & FLAGS_TEMPORARY_ON_REZ) == 0)
 				{
+					//send to object cache
 					regionp->cacheFullUpdate(compressed_dp, flags);
 					continue;
 				}
diff --git a/indra/newview/llviewerpartsim.cpp b/indra/newview/llviewerpartsim.cpp
index b066793e3dc94aa55c4e131e9eb90a8612250981..25cf082751fd02ce4a84fa2b0ef2aefd2d9fd24b 100644
--- a/indra/newview/llviewerpartsim.cpp
+++ b/indra/newview/llviewerpartsim.cpp
@@ -756,7 +756,7 @@ void LLViewerPartSim::updateSimulation()
 		LLViewerObject* vobj = mViewerPartGroups[i]->mVOPartGroupp;
 
 		S32 visirate = 1;
-		if (vobj)
+		if (vobj && !vobj->isDead() && vobj->mDrawable && !vobj->mDrawable->isDead())
 		{
 			LLSpatialGroup* group = vobj->mDrawable->getSpatialGroup();
 			if (group && !group->isVisible()) // && !group->isState(LLSpatialGroup::OBJECT_DIRTY))
@@ -767,7 +767,7 @@ void LLViewerPartSim::updateSimulation()
 
 		if ((LLDrawable::getCurrentFrame()+mViewerPartGroups[i]->mID)%visirate == 0)
 		{
-			if (vobj)
+			if (vobj && !vobj->isDead())
 			{
 				gPipeline.markRebuild(vobj->mDrawable, LLDrawable::REBUILD_ALL, TRUE);
 			}