Skip to content

Commit

Permalink
Do not attempt to add resource roots that do not contain any data
Browse files Browse the repository at this point in the history
  • Loading branch information
lincolnthree committed Jan 20, 2013
1 parent d694bec commit 50028d3
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected ModuleSpec findModule(ModuleIdentifier id) throws ModuleLoadException

/**
* Loads a module based on the {@link AddonId}
*
*
* @param addonId
* @return
* @throws ModuleLoadException
Expand Down Expand Up @@ -148,11 +148,12 @@ private void addLocalResources(AddonId found, Builder builder)
{
try
{
builder.addResourceRoot(
ResourceLoaderSpec.createResourceLoaderSpec(
ResourceLoaders.createJarResourceLoader(file.getName(), new JarFile(file)),
PathFilters.acceptAll())
);
if (file.length() > 0)
builder.addResourceRoot(
ResourceLoaderSpec.createResourceLoaderSpec(
ResourceLoaders.createJarResourceLoader(file.getName(), new JarFile(file)),
PathFilters.acceptAll())
);
}
catch (IOException e)
{
Expand Down

0 comments on commit 50028d3

Please sign in to comment.