fix condition (thanks to Andrey)
authorSergey Simonchik <sergey.simonchik@jetbrains.com>
Mon, 12 Sep 2016 12:05:51 +0000 (15:05 +0300)
committerSergey Simonchik <sergey.simonchik@jetbrains.com>
Mon, 12 Sep 2016 12:05:51 +0000 (15:05 +0300)
platform/projectModel-impl/src/com/intellij/openapi/roots/impl/RootModelImpl.java

index d35d7ba66f8aaee96152d1d66d8435f1344129a3..8d9e4a8f1b4bf6a59f01e8c0c87c8d8a9b7d125a 100644 (file)
@@ -226,7 +226,7 @@ public class RootModelImpl extends RootModelBase implements ModifiableRootModel
   public LibraryOrderEntry addLibraryEntry(@NotNull Library library) {
     assertWritable();
     final LibraryOrderEntry libraryOrderEntry = new LibraryOrderEntryImpl(library, this, myProjectRootManager);
-    if (libraryOrderEntry.isValid()) {
+    if (!libraryOrderEntry.isValid()) {
       LibraryEx libraryEx = ObjectUtils.tryCast(library, LibraryEx.class);
       boolean libraryDisposed = libraryEx != null ? libraryEx.isDisposed() : Disposer.isDisposed(library);
       throw new AssertionError("Invalid libraryOrderEntry, library: " + library