Skip to content

Commit 18484de

Browse files
TTtiePablete1234
andcommitted
chore: simplify mutual exclusivity check
Co-authored-by: Pablo Herrera <pabloherrerapalacio@gmail.com> Signed-off-by: TTtie <me@tttie.cz>
1 parent a3efeea commit 18484de

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

core/src/main/java/dev/pgm/community/serverlinks/ServerLinksConfig.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,9 @@ private ServerLink readLink(Map<?, ?> configData) {
4444
String customText = Objects.toString(configData.get(LINK_CUSTOM_TEXT_KEY), null);
4545
String uri = Objects.toString(configData.get(LINK_URI_KEY), null);
4646

47-
if (builtIn == null && customText == null) {
47+
if ((builtIn == null) == (customText == null)) {
4848
throw new IllegalStateException(
4949
"A server link must have either built-in or custom text defined");
50-
} else if (builtIn != null && customText != null) {
51-
throw new IllegalStateException(
52-
"A server link cannot have both built-in and custom text defined");
5350
}
5451

5552
URI parsedUri = parseUri(uri);

0 commit comments

Comments
 (0)