You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2014/12/12 13:35:42 UTC

svn commit: r1644866 - in /lucene/dev/branches/branch_5x: ./ solr/ solr/CHANGES.txt solr/core/ solr/core/src/java/org/apache/solr/update/processor/FieldValueMutatingUpdateProcessor.java

Author: noble
Date: Fri Dec 12 12:35:42 2014
New Revision: 1644866

URL: http://svn.apache.org/r1644866
Log:
SOLR-6626 NPE in FieldMutatingUpdateProcessor when indexing a doc with null field value

Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/solr/core/   (props changed)
    lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/FieldValueMutatingUpdateProcessor.java

Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1644866&r1=1644865&r2=1644866&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Fri Dec 12 12:35:42 2014
@@ -282,6 +282,9 @@ Bug Fixes
     implementation instead appends each input piece via the langdetect API.
   (Vitaliy Zhovtyuk, Tomás Fernández Löbbe, Rob Tulloh, Steve Rowe)
 
+* SOLR-6626: NPE in FieldMutatingUpdateProcessor when indexing a doc with
+  null field value (Noble Paul)
+
 Optimizations
 ----------------------
 

Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/FieldValueMutatingUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/FieldValueMutatingUpdateProcessor.java?rev=1644866&r1=1644865&r2=1644866&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/FieldValueMutatingUpdateProcessor.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/update/processor/FieldValueMutatingUpdateProcessor.java Fri Dec 12 12:35:42 2014
@@ -17,6 +17,8 @@
 
 package org.apache.solr.update.processor;
 
+import java.util.Collection;
+
 import org.apache.solr.common.SolrInputField;
 
 import org.slf4j.Logger;
@@ -61,8 +63,10 @@ public abstract class FieldValueMutating
   
   @Override
   protected final SolrInputField mutate(final SolrInputField src) {
+    Collection<Object> values = src.getValues();
+    if(values == null) return src;//don't mutate
     SolrInputField result = new SolrInputField(src.getName());
-    for (final Object srcVal : src.getValues()) {
+    for (final Object srcVal : values) {
       final Object destVal = mutateValue(srcVal);
       if (DELETE_VALUE_SINGLETON == destVal) { 
         /* NOOP */