Due to the comparison later on that calls toString on two different parameters. There is no toString() for null.