Add nullptr check

Change-Id: If511f1210cca7bd1da3a8c5152688487d3036e2f
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/redfish-core/lib/log_services.hpp b/redfish-core/lib/log_services.hpp
index f27785d..7522c03 100644
--- a/redfish-core/lib/log_services.hpp
+++ b/redfish-core/lib/log_services.hpp
@@ -3957,7 +3957,11 @@
     // Get the Message from the MessageRegistry
     const registries::Message* message =
         registries::getMessage("OpenBMC.0.2.BIOSPOSTCode");
-
+    if (message == nullptr)
+    {
+        BMCWEB_LOG_ERROR("Couldn't find known message?");
+        return false;
+    }
     uint64_t currentCodeIndex = 0;
     uint64_t firstCodeTimeUs = 0;
     for (const std::pair<uint64_t, std::tuple<uint64_t, std::vector<uint8_t>>>&
diff --git a/redfish-core/lib/pcie.hpp b/redfish-core/lib/pcie.hpp
index 9392916..223522b 100644
--- a/redfish-core/lib/pcie.hpp
+++ b/redfish-core/lib/pcie.hpp
@@ -712,7 +712,11 @@
     {
         const std::string* strProperty =
             std::get_if<std::string>(&property.second);
-
+        if (strProperty == nullptr)
+        {
+            BMCWEB_LOG_ERROR("Function wasn't a string?");
+            continue;
+        }
         if (property.first == functionName + "DeviceId")
         {
             resp.jsonValue["DeviceId"] = *strProperty;
@@ -799,11 +803,12 @@
                                    systemName);
         return;
     }
+    std::string_view pcieFunctionIdView = pcieFunctionIdStr;
 
     uint64_t pcieFunctionId = 0;
     std::from_chars_result result = std::from_chars(
-        &*pcieFunctionIdStr.begin(), &*pcieFunctionIdStr.end(), pcieFunctionId);
-    if (result.ec != std::errc{} || result.ptr != &*pcieFunctionIdStr.end())
+        pcieFunctionIdView.begin(), pcieFunctionIdView.end(), pcieFunctionId);
+    if (result.ec != std::errc{} || result.ptr != pcieFunctionIdView.end())
     {
         messages::resourceNotFound(asyncResp->res, "PCIeFunction",
                                    pcieFunctionIdStr);