From 5d30a9144ac592f28fb8a7736f041de7e24d2ae3 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 28 Jan 2024 14:57:44 +0100 Subject: [PATCH] Fix error handler --- src/de/steamwar/bungeecore/Subserver.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/de/steamwar/bungeecore/Subserver.java b/src/de/steamwar/bungeecore/Subserver.java index f7f4db7..c37a0b5 100644 --- a/src/de/steamwar/bungeecore/Subserver.java +++ b/src/de/steamwar/bungeecore/Subserver.java @@ -176,14 +176,14 @@ public class Subserver { } protected void register() { - synchronized (serverList) { - if(ProxyServer.getInstance().getServers().containsKey(serverName)) { - SecurityException e = new SecurityException("Server already registered: " + serverName); - stop(); - failureCallback.accept(e); - throw e; - } + if(ProxyServer.getInstance().getServers().containsKey(serverName)) { + SecurityException e = new SecurityException("Server already registered: " + serverName); + stop(); + failureCallback.accept(e); + throw e; + } + synchronized (serverList) { ProxyServer.getInstance().getServers().put(serverName, server); serverList.add(this); infoToServer.put(server, this);