private List<ProjectFileWrapper> getSelectedProjectFileWrappers(boolean filesOnly) {
List<ProjectFileWrapper> selectedProjectFileWrappers = new ArrayList<ProjectFileWrapper>();
TreePath[] selectedPaths = fileTree.getSelectionPaths();
- for (TreePath selectedPath : selectedPaths) {
- ProjectFileWrapper projectFileWrapper = (ProjectFileWrapper) selectedPath.getLastPathComponent();
- if (filesOnly && !projectFileWrapper.getProjectFile().isFile()) {
- continue;
+ if (selectedPaths != null) {
+ for (TreePath selectedPath : selectedPaths) {
+ ProjectFileWrapper projectFileWrapper = (ProjectFileWrapper) selectedPath.getLastPathComponent();
+ if (filesOnly && !projectFileWrapper.getProjectFile().isFile()) {
+ continue;
+ }
+ selectedProjectFileWrappers.add(projectFileWrapper);
}
- selectedProjectFileWrappers.add(projectFileWrapper);
}
return selectedProjectFileWrappers;
}