Yes it does throw a NPE. So, I just removed the null check.