This null check is fine. I'm guessing it came up in a spring-based unit test