Replaced std::map::at with std::map::find

Replaced std::map::at with std::map::find in lib/thermal.hpp, this
doesn't uses exceptions and return value is properly checked before
using it.

Tested:
- GET redfish/v1/Chassis/chassis/Thermal displays same content as before

Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: I9123a5081cb76dcbe3620a59b46408a6b8c9cda2
diff --git a/redfish-core/lib/thermal.hpp b/redfish-core/lib/thermal.hpp
index af31831..e064f1f 100644
--- a/redfish-core/lib/thermal.hpp
+++ b/redfish-core/lib/thermal.hpp
@@ -47,10 +47,17 @@
 
             return;
         }
+
+        auto thermalPaths = sensors::dbus::paths.find(sensors::node::thermal);
+        if (thermalPaths == sensors::dbus::paths.end())
+        {
+            messages::internalError(asyncResp->res);
+            return;
+        }
+
         const std::string& chassisName = params[0];
         auto sensorAsyncResp = std::make_shared<SensorsAsyncResp>(
-            asyncResp, chassisName,
-            sensors::dbus::paths.at(sensors::node::thermal),
+            asyncResp, chassisName, thermalPaths->second,
             sensors::node::thermal);
 
         // TODO Need to get Chassis Redundancy information.
@@ -67,6 +74,13 @@
             return;
         }
 
+        auto thermalPaths = sensors::dbus::paths.find(sensors::node::thermal);
+        if (thermalPaths == sensors::dbus::paths.end())
+        {
+            messages::internalError(asyncResp->res);
+            return;
+        }
+
         const std::string& chassisName = params[0];
         std::optional<std::vector<nlohmann::json>> temperatureCollections;
         std::optional<std::vector<nlohmann::json>> fanCollections;
@@ -74,8 +88,7 @@
             allCollections;
 
         auto sensorsAsyncResp = std::make_shared<SensorsAsyncResp>(
-            asyncResp, chassisName,
-            sensors::dbus::paths.at(sensors::node::thermal),
+            asyncResp, chassisName, thermalPaths->second,
             sensors::node::thermal);
 
         if (!json_util::readJson(req, sensorsAsyncResp->asyncResp->res,