PR check for null before opening file dialog
@@ -234,14 +234,16 @@ public class MainMenu extends MenuBar {
* Adds a selected resource to the current workspace.
*/
private void addLibrary() {
- fcLoadApp.setInitialDirectory(config().getRecentLoadDir());
- List<File> files = fcLoadApp.showOpenMultipleDialog(null);
- if (files != null) {
final Workspace workspace = controller.getWorkspace();
if (workspace == null)
return;
+ fcLoadApp.setInitialDirectory(config().getRecentLoadDir());
+ List<File> files = fcLoadApp.showOpenMultipleDialog(null);
+
+ if (files != null) {
+
for (File file : files) {
try {
JavaResource resource = FileSystemResource.of(file.toPath());
