completing previous commit with the case where the list can be null.