Skip to content

Bug Fix #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import com.github.sidhant92.boolparser.constant.ContainerDataType;
import com.github.sidhant92.boolparser.constant.DataType;
Expand Down Expand Up @@ -62,10 +63,11 @@ private Object evaluateToken(final Node node, final Map<String, Object> data) {
}

private Object evaluateFieldToken(final FieldNode fieldNode, final Map<String, Object> data) {
if (!data.containsKey(fieldNode.getField())) {
final Optional<Object> value = ValueUtils.getValueFromMap(fieldNode.getField(), data);
if (!value.isPresent()) {
throw new DataNotFoundException(fieldNode.getField());
}
return data.get(fieldNode.getField());
return value.get();
}

private Object evaluateUnaryToken(final UnaryNode unaryNode, final Map<String, Object> data) {
Expand Down
Loading