check that object exists, befor accessing a property