diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-06-22 12:15:30 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-06-22 12:15:30 +0200 |
commit | 3c62ec294306e957e376fb79501758d4f90ebd28 (patch) | |
tree | bf2287fa37abf3d0f665c6264c0c3c18a66f9dab /searchcore | |
parent | 50fec910c652a9f2cfadc781acd522a3a638b53c (diff) |
Do not go past numDocs..
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/vespa/searchcore/proton/server/documentretriever.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentretriever.cpp b/searchcore/src/vespa/searchcore/proton/server/documentretriever.cpp index e2315f4d633..4b031f28900 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentretriever.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentretriever.cpp @@ -127,9 +127,12 @@ void DocumentRetriever::populate(DocumentIdT lid, Document & doc) const { for (uint32_t i = 0; i < _schema.getNumAttributeFields(); ++i) { const Schema::AttributeField &field = _schema.getAttributeField(i); - AttributeGuard::UP attr = _attr_manager.getAttribute(field.getName()); - if (attr.get() && attr->valid()) { - DocumentFieldRetriever::populate(lid, doc, field, **attr, _schema.isIndexField(field.getName())); + AttributeGuard::UP attrGuard = _attr_manager.getAttribute(field.getName()); + if (attrGuard.get() && attrGuard->valid()) { + const search::attribute::IAttributeVector & attr = **attrGuard; + if (lid < attr.getNumDocs()) { + DocumentFieldRetriever::populate(lid, doc, field, attr, _schema.isIndexField(field.getName())); + } } } fillInPositionFields(doc, lid, _possiblePositionFields, _attr_manager); |