mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix NPE on adding a library with invalid roots
This commit is contained in:
+4
@@ -81,6 +81,10 @@ public class NewLibraryEditor implements LibraryEditor {
|
||||
List<VirtualFile> result = new ArrayList<VirtualFile>();
|
||||
for (LightFilePointer pointer : myRoots.get(rootType)) {
|
||||
final VirtualFile file = pointer.getFile();
|
||||
if (file == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (file.isDirectory()) {
|
||||
final Boolean recursively = myJarDirectories.get(file.getUrl());
|
||||
if (recursively != null) {
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.intellij.openapi.vfs.JarFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.VirtualFileManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
@@ -35,6 +36,7 @@ public class LightFilePointer {
|
||||
myFile = file;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public VirtualFile getFile() {
|
||||
refreshFile();
|
||||
return myFile;
|
||||
|
||||
Reference in New Issue
Block a user