diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index 0cceba6cb004d39939b7aff1e54e0f89be212a7f..a78dede34483ba261f28f825c199b26a7a131888 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -666,6 +666,11 @@ void LLAppearanceManager::filterWearableItems(
 		if (!item->isWearableType())
 			continue;
 		EWearableType type = item->getWearableType();
+		if(type < 0 || type >= WT_COUNT)
+		{
+			LL_WARNS("Appearance") << "Invalid wearable type. Type does not match wearable flag bitfield." << LL_ENDL;
+			continue;
+		}
 		items_by_type[type].push_back(item);
 	}