How to check if some object is empty

Well it’s not clear to me $(Subject).For example:
I don’t want to Write() some histograms if they are empty i.e not Fill()ed.

GetEntries() is working sorry for the question