How do I get model vertex color attributes?

I tried using the following code to get the color property of the current static mesh, but I couldn’t get it!!the code as follows:

TArray VertexColors;
FColorVertexBuffer* ColorBuffer = &(GetStaticMesh()->RenderData->LODResources[0].ColorVertexBuffer);
ColorBuffer->GetVertexColors(VertexColors);
then VertexColors is empty