remove these checks, using O.GetID() and then checking if it isn't null is enough