github-advanced-security[bot] commented on code in PR #1292:
URL: https://github.com/apache/syncope/pull/1292#discussion_r2737191696


##########
ext/opensearch/persistence/src/main/java/org/apache/syncope/core/persistence/opensearch/dao/OpenSearchAuditEventDAO.java:
##########
@@ -182,17 +179,15 @@
                 build();
         LOG.debug("Search request: {}", request);
 
-        List<Hit<ObjectNode>> esResult = null;
+        List<Hit<AuditEventTO>> osResult = null;
         try {
-            esResult = client.search(request, ObjectNode.class).hits().hits();
+            osResult = client.search(request, 
AuditEventTO.class).hits().hits();
         } catch (Exception e) {
             LOG.error("While searching in OpenSearch with request {}", 
request, e);
         }
 
-        return CollectionUtils.isEmpty(esResult)
+        return CollectionUtils.isEmpty(osResult)
                 ? List.of()
-                : esResult.stream().
-                        map(hit -> POJOHelper.convertValue(hit.source(), 
AuditEventTO.class)).
-                        filter(Objects::nonNull).toList();
+                : osResult.stream().map(Hit::source).toList();

Review Comment:
   ## Dereferenced variable may be null
   
   Variable [osResult](1) may be null at this access because of [this](2) 
assignment.
   
   [Show more 
details](https://github.com/apache/syncope/security/code-scanning/2511)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to