there is already an assertion to check the sensor device. the if block can probably be removed