mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 12:17:41 +08:00
NPE when enter blank string into maximum results field in WebFilter #PL-3005
This commit is contained in:
parent
6943289dda
commit
550b60b2f0
@ -433,16 +433,19 @@ public class WebFilter extends WebAbstractComponent<CubaVerticalActionsLayout> i
|
||||
applyDatasourceFilter();
|
||||
|
||||
if (useMaxResults) {
|
||||
int maxResults;
|
||||
if (BooleanUtils.isTrue(maxResultsCb.getValue()))
|
||||
try {
|
||||
//noinspection ConstantConditions
|
||||
maxResults = Datatypes.get(Integer.class).parse(maxResultsField.getValue(), userSessionSource.getLocale());
|
||||
} catch (ParseException e) {
|
||||
throw new Validator.InvalidValueException("");
|
||||
}
|
||||
else
|
||||
maxResults = persistenceManager.getMaxFetchUI(datasource.getMetaClass().getName());
|
||||
int maxResults = 0;
|
||||
if (BooleanUtils.isTrue(maxResultsCb.getValue())) {
|
||||
String maxResultsFieldValue = maxResultsField.getValue();
|
||||
if (StringUtils.isNotBlank(maxResultsFieldValue)) {
|
||||
try {
|
||||
//noinspection ConstantConditions
|
||||
maxResults = Datatypes.get(Integer.class).parse(maxResultsFieldValue, userSessionSource.getLocale());
|
||||
} catch (ParseException e) {
|
||||
throw new Validator.InvalidValueException("");
|
||||
}
|
||||
} else
|
||||
maxResults = persistenceManager.getMaxFetchUI(datasource.getMetaClass().getName());
|
||||
}
|
||||
datasource.setMaxResults(maxResults);
|
||||
}
|
||||
if (datasource instanceof CollectionDatasource.SupportsPaging)
|
||||
|
Loading…
Reference in New Issue
Block a user