Add check for null sensor in SensorWorker.cs

This commit is contained in:
Denis-Cosmin Nutiu 2020-01-24 15:34:13 +02:00
parent d2134b20b6
commit 388e9da13d

View file

@ -23,6 +23,10 @@ namespace NucuCar.Sensors
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
{
if (Sensor == null)
{
return;
}
var sensorIdentifier = Sensor.GetIdentifier();
Logger?.LogInformation($"Starting sensor worker for {sensorIdentifier}");
TelemetryPublisher?.RegisterTelemeter(Sensor);