Shorten some code

This commit is contained in:
Keir Nellyer 2016-06-19 22:46:06 +01:00
parent f34c65111b
commit 2cfb84eece

View File

@ -194,16 +194,13 @@ public class ReportManager
}).thenCompose(reportIdOptional -> reportIdOptional.isPresent() ? _reportRepository.getReport(reportIdOptional.get()) : CompletableFuture.completedFuture(null))
.join();
if (report != null)
{
report.addReportReason(new ReportMessage(reporterId, reason, _serverName, _serverWeight));
}
else
if (report == null)
{
report = new Report(suspectId, category);
report.addReportReason(new ReportMessage(reporterId, reason, _serverName, _serverWeight));
}
report.addReportReason(new ReportMessage(reporterId, reason, _serverName, _serverWeight));
// todo store token for chat site
_reportRepository.updateReport(report)
.exceptionally(throwable -> {