better than NPE

This commit is contained in:
Stepan Koltsov
2012-06-14 19:38:03 +04:00
parent e4dfbc5726
commit 839413930b
@@ -131,6 +131,7 @@ public class CompileEnvironmentUtil {
return null;
}
@NotNull
public static List<Module> loadModuleScript(String moduleScriptFile, MessageCollector messageCollector) {
Disposable disposable = new Disposable() {
@Override
@@ -145,7 +146,7 @@ public class CompileEnvironmentUtil {
GenerationState generationState = KotlinToJVMBytecodeCompiler
.analyzeAndGenerate(new K2JVMCompileEnvironmentConfiguration(scriptEnvironment, messageCollector, false), false);
if (generationState == null) {
return null;
throw new CompileEnvironmentException("Module script " + moduleScriptFile + " analyze failed");
}
List<Module> modules = runDefineModules(dependencies, moduleScriptFile, generationState.getFactory());