Allow group joins without an expiration

This commit is contained in:
Ashcon Partovi 2017-08-27 18:29:03 -07:00 committed by GitHub
parent e4bed714f8
commit 1030c2d4f4
1 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@ import tc.oc.commons.core.util.ThrowingBiConsumer;
import tc.oc.minecraft.scheduler.Sync;
import javax.inject.Inject;
import java.time.Duration;
import java.time.Instant;
public class GroupCommands implements NestedCommands {
@ -64,7 +65,8 @@ public class GroupCommands implements NestedCommands {
}
public Instant end() {
try {
return add ? Instant.now().plus(CommandUtils.getDuration(args, 2, null)) : null;
Duration duration = CommandUtils.getDuration(args, 2, null);
return add && duration != null ? Instant.now().plus(duration) : null;
} catch(CommandException e) {
return null;
}