Fix potential NPE

Change-Id: Ic2c7243601b0830e0532818b2f4007d9c10e0de8