This was harmless because the function would just return null in release builds, which was checked. Theoretically this vertex group mapping shouldn't depend on the object type, but the vertex group API would have to move away from the object-level first.