Fix null pointer crash

Change-Id: Iff52c97f57a506fde392ed974c64017c622fee82