diff --git a/redfish-core/include/utils/query_param.hpp b/redfish-core/include/utils/query_param.hpp
index 7be2a40..53ef262 100644
--- a/redfish-core/include/utils/query_param.hpp
+++ b/redfish-core/include/utils/query_param.hpp
@@ -526,12 +526,12 @@
 };
 
 inline void findNavigationReferencesInArrayRecursive(
-    ExpandType eType, nlohmann::json::array_t* array,
+    ExpandType eType, nlohmann::json::array_t& array,
     const nlohmann::json::json_pointer& p, int depth, int skipDepth,
     bool inLinks, std::vector<ExpandNode>& out);
 
 inline void findNavigationReferencesInObjectRecursive(
-    ExpandType eType, nlohmann::json::object_t* obj,
+    ExpandType eType, nlohmann::json::object_t& obj,
     const nlohmann::json::json_pointer& p, int depth, int skipDepth,
     bool inLinks, std::vector<ExpandNode>& out);
 
@@ -556,7 +556,7 @@
         jsonResponse.get_ptr<nlohmann::json::array_t*>();
     if (array != nullptr)
     {
-        findNavigationReferencesInArrayRecursive(eType, array, p, depth,
+        findNavigationReferencesInArrayRecursive(eType, *array, p, depth,
                                                  skipDepth, inLinks, out);
     }
     nlohmann::json::object_t* obj =
@@ -565,18 +565,18 @@
     {
         return;
     }
-    findNavigationReferencesInObjectRecursive(eType, obj, p, depth, skipDepth,
+    findNavigationReferencesInObjectRecursive(eType, *obj, p, depth, skipDepth,
                                               inLinks, out);
 }
 
 inline void findNavigationReferencesInArrayRecursive(
-    ExpandType eType, nlohmann::json::array_t* array,
+    ExpandType eType, nlohmann::json::array_t& array,
     const nlohmann::json::json_pointer& p, int depth, int skipDepth,
     bool inLinks, std::vector<ExpandNode>& out)
 {
     size_t index = 0;
     // For arrays, walk every element in the array
-    for (auto& element : *array)
+    for (auto& element : array)
     {
         nlohmann::json::json_pointer newPtr = p / index;
         BMCWEB_LOG_DEBUG << "Traversing response at " << newPtr.to_string();
@@ -587,17 +587,17 @@
 }
 
 inline void findNavigationReferencesInObjectRecursive(
-    ExpandType eType, nlohmann::json::object_t* obj,
+    ExpandType eType, nlohmann::json::object_t& obj,
     const nlohmann::json::json_pointer& p, int depth, int skipDepth,
     bool inLinks, std::vector<ExpandNode>& out)
 {
     // Navigation References only ever have a single element
-    if (obj->size() == 1)
+    if (obj.size() == 1)
     {
-        if (obj->begin()->first == "@odata.id")
+        if (obj.begin()->first == "@odata.id")
         {
             const std::string* uri =
-                obj->begin()->second.get_ptr<const std::string*>();
+                obj.begin()->second.get_ptr<const std::string*>();
             if (uri != nullptr)
             {
                 BMCWEB_LOG_DEBUG << "Found " << *uri << " at " << p.to_string();
@@ -611,15 +611,15 @@
     }
 
     int newDepth = depth;
-    auto odataId = obj->find("@odata.id");
-    if (odataId != obj->end())
+    auto odataId = obj.find("@odata.id");
+    if (odataId != obj.end())
     {
         // The Redfish spec requires all resources to include the resource
         // identifier.  If the object has multiple elements and one of them is
         // "@odata.id" then that means we have entered a new level / expanded
         // resource.  We need to stop traversing if we're already at the desired
         // depth
-        if (obj->size() > 1)
+        if (obj.size() > 1)
         {
             if (depth == 0)
             {
@@ -638,7 +638,7 @@
     }
 
     // Loop the object and look for links
-    for (auto& element : *obj)
+    for (auto& element : obj)
     {
         bool localInLinks = inLinks;
         if (!localInLinks)
