From 9ae86035931a6856b836cac43ea0fab85dc2163e Mon Sep 17 00:00:00 2001 From: dan-du-car Date: Wed, 26 Jul 2023 15:55:45 +0000 Subject: [PATCH] address comments --- src/v2i-hub/CDASimAdapter/src/CDASimConnection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v2i-hub/CDASimAdapter/src/CDASimConnection.cpp b/src/v2i-hub/CDASimAdapter/src/CDASimConnection.cpp index 87962dcfc..7f2ed2d49 100644 --- a/src/v2i-hub/CDASimAdapter/src/CDASimConnection.cpp +++ b/src/v2i-hub/CDASimAdapter/src/CDASimConnection.cpp @@ -266,7 +266,7 @@ namespace CDASimAdapter{ if(_sensors_json_v.isArray()) { std::for_each( _sensors_json_v.begin(), _sensors_json_v.end(), [&result, &sensor_id](auto& item){ - if(item["sensor_id"] == sensor_id) + if(item.isMember("sensor_id") && item["sensor_id"] == sensor_id) { result = item; } @@ -274,7 +274,7 @@ namespace CDASimAdapter{ } else if(_sensors_json_v.isObject()) { - if(_sensors_json_v["sensor_id"] == sensor_id) + if(_sensors_json_v.isMember("sensor_id") && _sensors_json_v["sensor_id"] == sensor_id) { result = _sensors_json_v; }