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
halo crash?

Change-Id: Iba879efa0a5178e55f9a615d3c760e7926cf165e