Add null check to avoid null pointer de-references. Change-Id: I99d01e5f543cffdace8aa07f709265f0eb5d7ed9 CRs-Fixed: 2196070