Skip to content

Commit

Permalink
fix: check argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ybw0014 committed Aug 6, 2023
1 parent 622b3e1 commit ede8d29
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand All @@ -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);
}

Expand Down

0 comments on commit ede8d29

Please sign in to comment.