Do not fail on adding sources to libraries that can't be recognized (EA-73238)

It's valid situation when user in Gradle project had created ordinal Java module and wants to configure
it with Kotlin. We should add Gradle library to dependency but there's no need to configure sources for it.
This commit is contained in:
Nikolay Krasko
2016-07-21 20:30:17 +03:00
parent 0f4319de8e
commit adbb07f30b

View File

@@ -139,7 +139,9 @@ public abstract class KotlinWithLibraryConfigurator implements KotlinProjectConf
configureModuleWithLibraryClasses(module, libraryState, runtimeState, dirToCopyJar, collector);
Library library = getKotlinLibrary(project);
assert library != null : "Kotlin library should exists when adding sources root";
if (library == null) return;
String dirToCopySourcesJar = getPathToCopyFileTo(project, OrderRootType.SOURCES, defaultPath, pathFromDialog);
FileState sourcesState = getJarState(project, files.getRuntimeSourcesDestination(dirToCopySourcesJar), OrderRootType.SOURCES,
pathFromDialog == null);