How are you preventing a possible NPE, it's not clear to me since the for loop above has cell != null as the loop condition