more null checks

Change-Id: I973efd5e6e60f6598ce5526d3ecf7cb0b7111f97