Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-14198: Nullpointer exception in AuditEvent with AuthorizationContext (#1192)

Jan Høydahl75c64089a1c1
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index bc6def1849f..ff11702536a 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -221,6 +221,8 @@ Bug Fixes
* SOLR-13089: Fix lsof edge cases in the solr CLI script (Martijn Koster via janhoy)
+* SOLR-14198: Nullpointer exception in AuditEvent when initialized from AuthorizationContext (janhoy)
+
* SOLR-6613: TextField.analyzeMultiTerm does not throw an exception when Analyzer returns no terms. (Bruno Roustant)
* SOLR-14192: Race condition between SchemaManager and ZkIndexSchemaReader. (ab)
diff --git a/solr/core/src/java/org/apache/solr/security/AuditEvent.java b/solr/core/src/java/org/apache/solr/security/AuditEvent.java
index adcfa5b7bdc..63bc4cd9c75 100644
--- a/solr/core/src/java/org/apache/solr/security/AuditEvent.java
+++ b/solr/core/src/java/org/apache/solr/security/AuditEvent.java
@@ -170,9 +170,11 @@ public class AuditEvent {
.stream().map(r -> r.collectionName).collect(Collectors.toList());
setResource(authorizationContext.getResource());
this.requestType = RequestType.convertType(authorizationContext.getRequestType());
- authorizationContext.getParams().forEach(p -> {
- this.solrParams.put(p.getKey(), Arrays.asList(p.getValue()));
- });
+ if (authorizationContext.getParams() != null) {
+ authorizationContext.getParams().forEach(p -> {
+ this.solrParams.put(p.getKey(), Arrays.asList(p.getValue()));
+ });
+ }
}
/**