To fix fatal exception in system process due to NullPointerException.

Null pointer check added to avoid NullPointerException, that was leading fatal exception in system process hence framework rebooting.

Change-Id: Ia83a6178bd575954345020ef3a792a3445323808 CRs-fixed: 483763