fix NPE in SensorResource