Add check for null sensor in SensorWorker.cs
This commit is contained in:
parent
d2134b20b6
commit
388e9da13d
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue