From 4c07fbf953ac187a47907cdd2fe1176b77b7647a Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 26 Jan 2013 18:52:20 +1100 Subject: [PATCH] Cleaner error for plugins with no yaml. --- api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java index 56450d56..07cd79b2 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -153,6 +153,8 @@ public class PluginManager try (JarFile jar = new JarFile(file)) { JarEntry pdf = jar.getJarEntry("plugin.yml"); + Preconditions.checkNotNull(pdf, "Plugin must have a plugin.yml"); + try (InputStream in = jar.getInputStream(pdf)) { PluginDescription desc = yaml.loadAs(in, PluginDescription.class);