From ede8d29ef65c569974859530a737346e73ffe6cc Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 6 Aug 2023 12:41:40 -0400 Subject: [PATCH] fix: check argument --- .../thebusybiscuit/slimefun4/api/items/SlimefunItem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java index 9366893c5d..b4dbe1d21c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java @@ -892,6 +892,8 @@ public final void addOfficialWikipage(@Nonnull String page) { * The associated wiki page name. */ public final void addWikiPage(@Nonnull String page) { + Preconditions.checkArgument(page != null, "Wiki page cannot be null."); + Preconditions.checkState(getState() != ItemState.UNREGISTERED, "Wiki page can only be added after item has been registered."); addCustomWikiPage(getAddon().getWikiURL().replace("%item%", page)); } @@ -903,7 +905,6 @@ public final void addWikiPage(@Nonnull String page) { */ public final void addCustomWikiPage(@Nonnull String url) { Preconditions.checkArgument(url != null, "Wiki page cannot be null."); - Preconditions.checkState(getState() != ItemState.UNREGISTERED, "Wiki page can only be added after item has been registered."); wikiURL = Optional.of(url); }