Commits

Anonymous committed b0cb622

Crashfix; Change llassert_always to llassert + llwarns. This way users don't get disruptive crashes.

  • Participants
  • Parent commits 405ab9a

Comments (0)

Files changed (1)

indra/llrender/llvertexbuffer.cpp

 	gGL.syncMatrices();
 
 	U32 count = pos.size();
-	llassert_always(norm.size() >= pos.size());
-	llassert_always(count > 0);
+	
+	llassert(norm.size() >= pos.size());
+	llassert(count > 0);
+
+	if( count == 0 )
+	{
+		llwarns << "Called drawArrays with 0 vertices" << llendl;
+		return;
+	}
+
+	if( norm.size() < pos.size() )
+	{
+		llwarns << "Called drawArrays with #" << norm.size() << " normals and #" << pos.size() << " vertices" << llendl;
+		return;
+	}
 
 	unbind();