You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2017/01/06 20:20:56 UTC

lucene-solr:jira/solr-5944: SOLR-5944: Fixing an NPE due to previous commit

Repository: lucene-solr
Updated Branches:
  refs/heads/jira/solr-5944 2a9efd67a -> 5db04fdc4


SOLR-5944: Fixing an NPE due to previous commit


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/5db04fdc
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5db04fdc
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5db04fdc

Branch: refs/heads/jira/solr-5944
Commit: 5db04fdc4c081773412a19a0f08b329e76b86b25
Parents: 2a9efd6
Author: Ishan Chattopadhyaya <is...@apache.org>
Authored: Sat Jan 7 01:50:42 2017 +0530
Committer: Ishan Chattopadhyaya <is...@apache.org>
Committed: Sat Jan 7 01:50:42 2017 +0530

----------------------------------------------------------------------
 .../apache/solr/handler/component/RealTimeGetComponent.java   | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5db04fdc/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
index 138f294..d5a473a 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
@@ -238,16 +238,15 @@ public class RealTimeGetComponent extends SearchComponent
                  // For in-place update case, we have obtained the partial document till now. We need to
                  // resolve it to a full document to be returned to the user.
                  doc = (SolrDocument) resolveFullDocument(core, idBytes.get(), rsp.getReturnFields(), doc, entry, null);
-
+                 if (doc == null) {
+                   break; // document has been deleted as the resolve was going on
+                 }
                  // Since the partial doc from the tlog was obtained and resolved without ever having populated all
                  // the defaults and the copy fields before, we need to do it before returning. The call to toSolrDoc()
                  // here achieves that.
                  // nocommit: Is it possible to refactor these methods cleanly so that this double conversion (SD->SID->(Document->)SD)
                  // nocommit: can be avoided?
                  doc = toSolrDoc(toSolrInputDocument(doc, core.getLatestSchema()), core.getLatestSchema(), false);
-                 if (doc == null) {
-                   break;
-                 }
                }
                if (transformer!=null) {
                  transformer.transform(doc, -1, 0); // unknown docID