Fix a potential NPE.