Fix possible NPE.