How can I know whether an object exists in memory?

There’s a line in my codes: eftof_gate = (TCutG*) gROOT->GetListOfSpecials()->FindObject(“eftof_gate”) to get an TCutG, however, the object may not exist at all. Since my following codes depends on whether the object exists or not, how can I make a judgement on the existence of the object after the statement?

Thank you very much!

simply check if the returned pointer is null

Rene