From 52d66897e40be84baa0a721ab0c3ff1a1484d3c5 Mon Sep 17 00:00:00 2001 From: Tux Date: Sun, 6 Mar 2016 00:05:25 -0500 Subject: [PATCH] Raise an error if a server in the priority list is undefined --- .../src/main/java/net/md_5/bungee/conf/Configuration.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java index 7d52931e..25d87d97 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/Configuration.java @@ -115,8 +115,11 @@ public class Configuration implements ProxyConfig for ( ListenerInfo listener : listeners ) { - Preconditions.checkArgument( servers.containsKey( listener.getDefaultServer() ), "Default server %s is not defined", listener.getDefaultServer() ); - Preconditions.checkArgument( servers.containsKey( listener.getFallbackServer() ), "Fallback server %s is not defined", listener.getFallbackServer() ); + for ( int i = 0; i < listener.getServerPriority().size(); i++ ) + { + String server = listener.getServerPriority().get( i ); + Preconditions.checkArgument( servers.containsKey( server ), "Server %s (priority %s) is not defined", server, i ); + } for ( String server : listener.getForcedHosts().values() ) { if ( !servers.containsKey( server ) )