Direct access to StaticMesh member is deprecated and will be made private soon

Hi, I’m a newbie here. Any help on how to resolve the following code error is appreciated;

AStaticMeshActor *worldMesh = Cast(actor);

//if params is static
if (!worldMesh) {
	UE_LOG(JsonLog, Warning, TEXT("Wrong actor class"));
	return;
}
	
auto meshComp = worldMesh->GetStaticMeshComponent();	

meshComp->StaticMesh = meshObject;//Having an issue here.

The error message in VS 2017 as follows: Direct access to StaticMesh member is deprecated and will be made private soon. Please use SetStaticMesh and GetStaticMesh.

Check out this question, you may find it pretty similar to your, and the asnwer is pretty clear too.

Thank you for the quick response. Already resolved my issue.