better than NPE
This commit is contained in:
@@ -131,6 +131,7 @@ public class CompileEnvironmentUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
public static List<Module> loadModuleScript(String moduleScriptFile, MessageCollector messageCollector) {
|
public static List<Module> loadModuleScript(String moduleScriptFile, MessageCollector messageCollector) {
|
||||||
Disposable disposable = new Disposable() {
|
Disposable disposable = new Disposable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -145,7 +146,7 @@ public class CompileEnvironmentUtil {
|
|||||||
GenerationState generationState = KotlinToJVMBytecodeCompiler
|
GenerationState generationState = KotlinToJVMBytecodeCompiler
|
||||||
.analyzeAndGenerate(new K2JVMCompileEnvironmentConfiguration(scriptEnvironment, messageCollector, false), false);
|
.analyzeAndGenerate(new K2JVMCompileEnvironmentConfiguration(scriptEnvironment, messageCollector, false), false);
|
||||||
if (generationState == null) {
|
if (generationState == null) {
|
||||||
return null;
|
throw new CompileEnvironmentException("Module script " + moduleScriptFile + " analyze failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Module> modules = runDefineModules(dependencies, moduleScriptFile, generationState.getFactory());
|
List<Module> modules = runDefineModules(dependencies, moduleScriptFile, generationState.getFactory());
|
||||||
|
|||||||
Reference in New Issue
Block a user