Skip to content

Commit

Permalink
Merge pull request #496 from FgForrest/dev
Browse files Browse the repository at this point in the history
fix(#495): NPE in AttributeBitmap calculation
  • Loading branch information
novoj authored Mar 19, 2024
2 parents fd59206 + 11ad92a commit 705c161
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,6 @@ public AttributeSchemaContract getAttributeSchema(@Nonnull EntitySchemaContract
return getProcessingScope().getAttributeSchemaAccessor().getAttributeSchema(entitySchema, attributeName, requiredTrait);
}

/**
* Returns attribute values from current scope.
*/
@Nonnull
public Stream<Optional<AttributeValue>> getAttributeValueStream(@Nonnull EntityContract entity, @Nonnull String attributeName, @Nonnull Locale locale) {
return getProcessingScope().getAttributeValueStream(entity, attributeName, locale);
}

/**
* Method returns true if any of the siblings of the currently examined query matches any of the passed types.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,11 @@ public Bitmap filter(@Nonnull FilterByVisitor filterByVisitor) {
filter = filterFactory.apply(attributeSchema);
}
// and filter by predicate
if (filter != null && filter.test(attributeValueAccessor.apply(entity, attributeName))) {
result.add(filterByVisitor.translateEntity(entity));
if (filter != null) {
final Stream<Optional<AttributeValue>> valueStream = attributeValueAccessor.apply(entity, attributeName);
if (valueStream != null && filter.test(valueStream)) {
result.add(filterByVisitor.translateEntity(entity));
}
}
}
return result;
Expand Down

0 comments on commit 705c161

Please sign in to comment.