Fix a possible NPE.