Create constraint only if value is not null and removes null entries from the list