File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
src/main/java/net/pistonmaster/pistonqueue Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -243,10 +243,13 @@ private void sendCustomData() {
243243
244244 private void initializeReservationSlots () {
245245 getProxy ().getScheduler ().schedule (this , () -> {
246- ServerInfo mainServer = getProxy ().getServerInfo (Config .MAINSERVER );
246+ Optional <ServerInfo > mainServer = Optional .ofNullable (getProxy ().getServerInfo (Config .MAINSERVER ));
247+ if (!mainServer .isPresent ())
248+ return ;
249+
247250 Map <QueueType , AtomicInteger > map = new EnumMap <>(QueueType .class );
248251
249- for (ProxiedPlayer player : mainServer .getPlayers ()) {
252+ for (ProxiedPlayer player : mainServer .get (). getPlayers ()) {
250253 QueueType playerType = QueueType .getQueueType (player ::hasPermission );
251254
252255 if (map .containsKey (playerType )) {
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ private void sendCustomData() {
237237 private void initializeReservationSlots () {
238238 proxyServer .getScheduler ().buildTask (this , () -> {
239239 if (!proxyServer .getServer (Config .MAINSERVER ).isPresent ())
240- throw new IllegalStateException ( "Main server not configured properly!!!" ) ;
240+ return ;
241241
242242 RegisteredServer mainServer = proxyServer .getServer (Config .MAINSERVER ).get ();
243243 Map <QueueType , AtomicInteger > map = new EnumMap <>(QueueType .class );
You can’t perform that action at this time.
0 commit comments