Just make a bluetility for it.
The foliage actor is a list of instanced meshes.
Mostly Accessible via blueprint (check dynofoliage in the marketplace).
Removing invalid instances should be somewhat trivial via code.
Looping over all instances is however probably impossible - processing time wise- with in engine bluetility.
So you have to devise a way that doesn’t loop.
In theory that should not be an issue because all meshes are listed within the actor. You should be able to spot the invalid/null mesh, select all related instances and delete them.
Or maybe just assign a mesh programmatically.