Replace switch by if to correctly handle null values