Check if object is deleted before serializing.