Skip to content

Commit

Permalink
Fix flag state filters on load
Browse files Browse the repository at this point in the history
Signed-off-by: Pablete1234 <[email protected]>
  • Loading branch information
Pablete1234 authored and Electroid committed Aug 4, 2022
1 parent 42c8279 commit 080e659
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public Class<? extends MatchQuery> queryType() {
@Override
public boolean matches(MatchQuery query) {
Flag flag = this.flag.get().getGoal(query.getMatch());
if (flag == null) throw new IllegalStateException("Flag not found");
// FIXME: This may occur at load time. We need a better fix for this.
if (flag == null) return false;

return flag.isCurrent(this.state) && (this.post == null || flag.isAtPost(this.post.get()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public ContextStore<?> getUsedContext() {
public Filter parse(Element el) throws InvalidXMLException {
Filter filter = this.parseDynamic(el);
if (!(filter instanceof FeatureReference)) {
factory.getFeatures().addFeature(el, (FilterDefinition) filter);
factory.getFeatures().addFeature(el, filter);
}
return filter;
}
Expand Down

0 comments on commit 080e659

Please sign in to comment.