diff --git a/src/main/java/net/coreprotect/database/Lookup.java b/src/main/java/net/coreprotect/database/Lookup.java index cc8247b..9b9593e 100755 --- a/src/main/java/net/coreprotect/database/Lookup.java +++ b/src/main/java/net/coreprotect/database/Lookup.java @@ -559,7 +559,7 @@ public class Lookup extends Queue { queryEntity = queryEntity.replace("type NOT IN(" + (excludeBlock.length() > 0 ? excludeBlock : "0") + ")", "type NOT IN(" + (excludeEntity.length() > 0 ? excludeEntity : "0") + ")"); } - String baseQuery = (includeEntity.length() > 0 ? queryEntity : queryBlock); + String baseQuery = ((!includeEntity.isEmpty() || !excludeEntity.isEmpty()) ? queryEntity : queryBlock); if (limitOffset > -1 && limitCount > -1) { queryLimit = " LIMIT " + limitOffset + ", " + limitCount + ""; }