This check is unnecessary. If the variable is null, then a NullPointerException will be thrown in the very next line anyway.