Fix sql error when a report is closed due to expiration

This commit is contained in:
Keir Nellyer 2016-07-09 11:31:51 -04:00
parent abea5bbf81
commit 0783f3b693

View File

@ -183,9 +183,12 @@ public class ReportManager
OfflinePlayer suspect = Bukkit.getOfflinePlayer(suspectUUID);
String suspectName = suspect.getName();
int closerId = reportCloser != null ? _clientManager.Get(reportCloser).getAccountId() : -1;
if (reportCloser != null)
{
int closerId = _clientManager.Get(reportCloser).getAccountId();
report.setHandlerId(closerId);
}
report.setHandlerId(closerId);
report.setReportResult(reportResult);
_reportRepository.updateReport(report).thenAccept(reportId ->
{
@ -311,6 +314,7 @@ public class ReportManager
if (priority <= 0)
{
System.out.println("Closing report due to expiration");
closeReport(report, null, new ReportResult(ReportResultType.EXPIRED, null));
}