Fix potential NPE.