Skip to content

Commit 2376aa1

Browse files
committed
support empty constraint expression
1 parent 3bec883 commit 2376aa1

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

core/src/com/biglybt/core/tag/impl/TagPropertyConstraintHandler.java

+33-1
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,11 @@ public void tagTypeAdded(TagManager manager, TagType tag_type){
16231623
{
16241624
str = removeComments( str );
16251625

1626-
if ( str.equalsIgnoreCase( "true" )){
1626+
if ( str.isEmpty() || str.equalsIgnoreCase( "false" )){
1627+
1628+
return( new ConstraintExprFalse());
1629+
1630+
}else if ( str.equalsIgnoreCase( "true" )){
16271631

16281632
return( new ConstraintExprTrue());
16291633
}
@@ -2262,6 +2266,34 @@ public void tagTypeAdded(TagManager manager, TagType tag_type){
22622266
}
22632267
}
22642268

2269+
private static class
2270+
ConstraintExprFalse
2271+
implements ConstraintExpr
2272+
{
2273+
@Override
2274+
public Object
2275+
eval(
2276+
Map<String,Object> context,
2277+
DownloadManager dm,
2278+
List<Tag> tags,
2279+
StringBuilder debug )
2280+
{
2281+
if ( debug != null ){
2282+
2283+
debug.append( getString());
2284+
}
2285+
2286+
return( false );
2287+
}
2288+
2289+
@Override
2290+
public String
2291+
getString()
2292+
{
2293+
return( "false" );
2294+
}
2295+
}
2296+
22652297
private class
22662298
ConstraintExprParams
22672299
implements ConstraintExpr

0 commit comments

Comments
 (0)