Skip to content

Commit

Permalink
Fixing superfluous "not applicable" message in object lists (MID-4380)
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Feb 15, 2018
1 parent 3993285 commit cd811b2
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -233,9 +233,9 @@ protected int internalSize() {
return Integer.MAX_VALUE;
}
int count = 0;
OperationResult result = new OperationResult(OPERATION_COUNT_OBJECTS);
Task task = getPage().createSimpleTask(OPERATION_COUNT_OBJECTS);
OperationResult result = task.getResult();
try {
Task task = getPage().createSimpleTask(OPERATION_COUNT_OBJECTS);
Integer counted = getModel().countObjects(type, getQuery(), options, task, result);
count = defaultIfNull(counted, 0);
} catch (Exception ex) {
Expand All @@ -244,8 +244,8 @@ protected int internalSize() {
} finally {
result.computeStatusIfUnknown();
}

if (!WebComponentUtil.isSuccessOrHandledError(result)) {
if (!WebComponentUtil.isSuccessOrHandledError(result) && !result.isNotApplicable()) {
getPage().showResult(result);
// Let us do nothing. The error will be shown on the page and a count of 0 will be used.
// Redirecting to the error page does more harm than good (see also MID-4306).
Expand Down

0 comments on commit cd811b2

Please sign in to comment.