ifx possible NPE when asking for _parent without parent mapping

This commit is contained in:
Shay Banon 2011-09-02 12:58:20 +03:00
parent 63f2e84535
commit ed99a51406
1 changed files with 1 additions and 1 deletions

View File

@ -250,7 +250,7 @@ public class ShardGetService extends AbstractIndexShardComponent {
Object value = null;
if (field.equals(RoutingFieldMapper.NAME) && docMapper.routingFieldMapper().stored()) {
value = source.routing;
} else if (field.equals(ParentFieldMapper.NAME) && docMapper.parentFieldMapper().stored()) {
} else if (field.equals(ParentFieldMapper.NAME) && docMapper.parentFieldMapper() != null && docMapper.parentFieldMapper().stored()) {
value = source.parent;
} else if (field.equals(TimestampFieldMapper.NAME) && docMapper.timestampFieldMapper().stored()) {
value = source.timestamp;