Skip to content
This repository
Browse code

CeylonModuleLoader: no NPE when module is null, and turn "null" versi…

…on into null for the default module
  • Loading branch information...
commit ec2970a5f5aeefcabaf69e6668ff50fee18a4318 1 parent 169af46
Stéphane Épardaud FroMage authored
8 impl/src/main/java/ceylon/modules/jboss/runtime/CeylonModuleLoader.java
@@ -183,8 +183,12 @@ private void relink(ModuleIdentifier mi, Set<ModuleIdentifier> visited) throws M
183 183 }
184 184
185 185 final Module module = super.preloadModule(mi);
186   - ArtifactResult result = artifacts.get(mi);
187   - com.redhat.ceylon.compiler.java.Util.loadModule(mi.getName(), mi.getSlot(), result, SecurityActions.getClassLoader(module));
  186 + if(module != null){
  187 + ArtifactResult result = artifacts.get(mi);
  188 + // transform "null" into null version for the default module
  189 + String version = mi.getName().equals(RepositoryManager.DEFAULT_MODULE) ? null : mi.getSlot();
  190 + com.redhat.ceylon.compiler.java.Util.loadModule(mi.getName(), version, result, SecurityActions.getClassLoader(module));
  191 + }
188 192
189 193 return module;
190 194 }

0 comments on commit ec2970a

Please sign in to comment.
Something went wrong with that request. Please try again.