Don't allow players to handle new accounts in exceptional cases

This commit is contained in:
Keir Nellyer 2016-09-30 01:28:07 +01:00
parent 4818936943
commit de72f119fe
2 changed files with 5 additions and 10 deletions

View File

@ -519,14 +519,6 @@ public class ReportManager
CompletableFuture<List<Long>> future = _reportRepository.getReportsHandling(accountId);
return future.thenApply(reportIds -> {
// if for some reason we cannot fetch the report a user is handling
// assume the worst and return true
// this means we do not end up allowing a user to handle multiple reports simultaneously
if (reportIds == null)
{
return true;
}
for (long reportId : reportIds)
{
if (isActiveReport(reportId).join())
@ -536,7 +528,10 @@ public class ReportManager
}
return false;
});
}).exceptionally(throwable -> true);
// ^ if for some reason we cannot fetch the report a user is handling
// assume the worst and return true
// this means we do not end up allowing a user to handle multiple reports simultaneously
}
/**

View File

@ -230,7 +230,7 @@ public class ReportRepository
future.exceptionally(throwable ->
{
_logger.log(Level.SEVERE, "Error fetching reports being handled by specified account.", throwable);
return new ArrayList<>();
return null;
});
return future;