Quick fix for antifeature crash

This commit is contained in:
Sylvia van Os
2021-12-21 22:27:56 +01:00
parent 2a8b16683a
commit 815a2cd348

View File

@@ -1045,25 +1045,29 @@ public final class Utils {
StringBuilder antiFeatureFilter = new StringBuilder(Schema.AppMetadataTable.NAME)
.append(".")
.append(Schema.AppMetadataTable.Cols.ANTI_FEATURES)
.append(" IS NULL OR (");
.append(" IS NULL");
for (int i = 0; i < unwantedAntifeatures.size(); i++) {
String unwantedAntifeature = unwantedAntifeatures.get(i);
if (!unwantedAntifeatures.isEmpty()) {
antiFeatureFilter.append(" OR (");
if (i > 0) {
antiFeatureFilter.append(" AND ");
for (int i = 0; i < unwantedAntifeatures.size(); i++) {
String unwantedAntifeature = unwantedAntifeatures.get(i);
if (i > 0) {
antiFeatureFilter.append(" AND ");
}
antiFeatureFilter.append(Schema.AppMetadataTable.NAME)
.append(".")
.append(Schema.AppMetadataTable.Cols.ANTI_FEATURES)
.append(" NOT LIKE '%")
.append(unwantedAntifeature)
.append("%'");
}
antiFeatureFilter.append(Schema.AppMetadataTable.NAME)
.append(".")
.append(Schema.AppMetadataTable.Cols.ANTI_FEATURES)
.append(" NOT LIKE '%")
.append(unwantedAntifeature)
.append("%'");
antiFeatureFilter.append(")");
}
antiFeatureFilter.append(")");
return antiFeatureFilter.toString();
}
}