Return null if argument is invalid.