Fix index out of bounds for '/p h'

This commit is contained in:
Traks 2021-07-22 15:51:54 +02:00 committed by dordsor21
parent 2676b76107
commit 8a77d5a450

View File

@ -76,7 +76,7 @@ public class HomeCommand extends Command {
if (plots.isEmpty()) {
player.sendMessage(TranslatableCaption.of("invalid.found_no_plots"));
return;
} else if (plots.size() < page) {
} else if (plots.size() < page || page < 1) {
player.sendMessage(
TranslatableCaption.of("invalid.number_not_in_range"),
Template.of("min", "1"),