Add guards for NULL sensors
Add guards for NULL sensors.

Approved by Ricardo Salveti, PS Jenkins bot.