diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 2a68fbac8d26596b096f77d258241334702f7a7b..0a1eadf4d059b32b9c9de35276ab90af352cf4b0 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -35,6 +35,7 @@
 #include "llappviewer.h"
 #include "llbufferstream.h"
 #include "llcurl.h"
+#include "lldatapacker.h"
 #include "llfasttimer.h"
 #include "llfloatermodelpreview.h"
 #include "llfloaterperms.h"
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 46cf9a24e93ec9290e661eb0db677cdfc6d854d1..f835351c04306f7047363afc238be2ee9b25e308 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1187,34 +1187,32 @@ LLDataPacker *LLViewerRegion::getDP(U32 local_id, U32 crc, U8 &cache_miss_type)
 {
 	//llassert(mCacheLoaded);  This assert failes often, changing to early-out -- davep, 2010/10/18
 
-	if (mCacheLoaded)
-	{
-		LLVOCacheEntry* entry = get_if_there(mCacheMap, local_id, (LLVOCacheEntry*)NULL);
+	LLVOCacheEntry* entry = get_if_there(mImpl->mCacheMap, local_id, (LLVOCacheEntry*)NULL);
 
-		if (entry)
+	if (entry)
+	{
+		// we've seen this object before
+		if (entry->getCRC() == crc)
 		{
-			// we've seen this object before
-			if (entry->getCRC() == crc)
-			{
-				// Record a hit
-				entry->recordHit();
-			cache_miss_type = CACHE_MISS_TYPE_NONE;
-				return entry->getDP(crc);
-			}
-			else
-			{
-				// llinfos << "CRC miss for " << local_id << llendl;
-			cache_miss_type = CACHE_MISS_TYPE_CRC;
-				mCacheMissCRC.put(local_id);
-			}
+			// Record a hit
+			entry->recordHit();
+		cache_miss_type = CACHE_MISS_TYPE_NONE;
+			return entry->getDP(crc);
 		}
 		else
 		{
-			// llinfos << "Cache miss for " << local_id << llendl;
-		cache_miss_type = CACHE_MISS_TYPE_FULL;
-			mCacheMissFull.put(local_id);
+			// llinfos << "CRC miss for " << local_id << llendl;
+		cache_miss_type = CACHE_MISS_TYPE_CRC;
+			mCacheMissCRC.put(local_id);
 		}
 	}
+	else
+	{
+		// llinfos << "Cache miss for " << local_id << llendl;
+	cache_miss_type = CACHE_MISS_TYPE_FULL;
+		mCacheMissFull.put(local_id);
+	}
+
 	return NULL;
 }