diff --git a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java index 8d79b5ab..a2b96815 100644 --- a/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java +++ b/proxy/src/main/java/net/md_5/bungee/conf/YamlConfig.java @@ -27,6 +27,7 @@ import net.md_5.bungee.api.config.ServerInfo; import net.md_5.bungee.util.CaseInsensitiveMap; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.error.YAMLException; public class YamlConfig implements ConfigurationAdapter { @@ -60,7 +61,13 @@ public class YamlConfig implements ConfigurationAdapter try ( InputStream is = new FileInputStream( file ) ) { - config = (Map) yaml.load( is ); + try + { + config = (Map) yaml.load( is ); + } catch ( YAMLException ex ) + { + throw new RuntimeException( "Invalid configuration encountered - this is a configuration error and NOT a bug! Please attempt to fix the error or see https://www.spigotmc.org/ for help.", ex ); + } } if ( config == null )