diff --git a/src/main/java/ca/tweetzy/auctionhouse/commands/CommandConvert.java b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandConvert.java index c54bc57..30e5834 100644 --- a/src/main/java/ca/tweetzy/auctionhouse/commands/CommandConvert.java +++ b/src/main/java/ca/tweetzy/auctionhouse/commands/CommandConvert.java @@ -34,6 +34,11 @@ public class CommandConvert extends AbstractCommand { ConfigurationSection activeSection = AuctionHouse.getInstance().getData().getConfigurationSection("active"); ConfigurationSection expiredSection = AuctionHouse.getInstance().getData().getConfigurationSection("expired"); + if (activeSection == null || expiredSection == null) { + AuctionHouse.getInstance().getLocale().newMessage(TextUtils.formatText("&4Active/Expired section(s) could not be found, have you ran the conversion command already?")).sendPrefixedMessage(sender); + return; + } + if (activeSection != null && activeSection.getKeys(false).size() != 0) { activeSection.getKeys(false).forEach(key -> AuctionHouse.getInstance().getAuctionItemManager().addItem(new AuctionItem( UUID.fromString(Objects.requireNonNull(AuctionHouse.getInstance().getData().getString("active." + key + ".owner"))), diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 24edf69..cc43d33 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -25,6 +25,7 @@ permissions: auctionhouse.cmd.settings: true auctionhouse.cmd.transactions: true auctionhouse.cmd.search: true + auctionhouse.cmd.convert: true auctionhouse.cmd: description: Allows the user to use /ah default: op @@ -45,4 +46,7 @@ permissions: default: op auctionhouse.cmd.search: description: Allows the user to search for auction items. + default: op + auctionhouse.cmd.convert: + description: Allows the user to run conversion command default: op \ No newline at end of file