Fix checking deleted schematic limbo

This commit is contained in:
Lixfel
2024-11-29 13:17:52 +01:00
parent 46c2de43a4
commit f51de58921

View File

@@ -272,12 +272,13 @@ public class CheckCommand extends SWCommand {
}
private boolean concludeCheckSession(String reason, SchematicType type) {
if(SchematicNode.getSchematicNode(schematic.getId()) == null) // Schematic was deleted
return false;
boolean exists = SchematicNode.getSchematicNode(schematic.getId()) != null;
CheckedSchematic.create(schematic, checker.user().getId(), startTime, Timestamp.from(Instant.now()), reason);
if(type != null)
schematic.setSchemtype(type);
if(exists) {
CheckedSchematic.create(schematic, checker.user().getId(), startTime, Timestamp.from(Instant.now()), reason);
if(type != null)
schematic.setSchemtype(type);
}
remove();
VelocityCore.schedule(() -> {
@@ -285,7 +286,7 @@ public class CheckCommand extends SWCommand {
if(subserver != null)
subserver.stop();
}).schedule();
return true;
return exists;
}
private void remove() {