Cleaner error for plugins with no yaml.

This commit is contained in:
md_5 2013-01-26 18:52:20 +11:00
parent b61758ca8e
commit 4c07fbf953

View File

@ -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);