Handling a possible NPE.