From d518ac2f4640c417a6f9cf0e1cd546cd4d56a1d3 Mon Sep 17 00:00:00 2001 From: LukasBuecherl Date: Wed, 14 Apr 2021 14:44:40 -0600 Subject: [PATCH] Fixed nullpointerexception in FileTree that resulted in bug when using the collapse/expand hierachy in the project overview. --- .../java/edu/utah/ece/async/ibiosim/gui/util/FileTree.java | 4 ++++ .../utah/ece/async/ibiosim/gui/util/tabs/CloseTabPaneUI.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gui/src/main/java/edu/utah/ece/async/ibiosim/gui/util/FileTree.java b/gui/src/main/java/edu/utah/ece/async/ibiosim/gui/util/FileTree.java index d638a1a3f..a42ec88ab 100644 --- a/gui/src/main/java/edu/utah/ece/async/ibiosim/gui/util/FileTree.java +++ b/gui/src/main/java/edu/utah/ece/async/ibiosim/gui/util/FileTree.java @@ -201,6 +201,9 @@ public void valueChanged(TreeSelectionEvent e) { } fileLocation = dir.getAbsolutePath() + fileLocation; + // Lukas added : + if(tree.getSelectionPaths() != null) { + fileLocations = new String[tree.getSelectionPaths().length]; int i = 0; for (TreePath path : tree.getSelectionPaths()) { @@ -225,6 +228,7 @@ public void valueChanged(TreeSelectionEvent e) { i++; } } + } }); tree.addMouseListener(this); tree.addMouseListener(gui); diff --git a/gui/src/main/java/edu/utah/ece/async/ibiosim/gui/util/tabs/CloseTabPaneUI.java b/gui/src/main/java/edu/utah/ece/async/ibiosim/gui/util/tabs/CloseTabPaneUI.java index f31a9f777..eff5db353 100644 --- a/gui/src/main/java/edu/utah/ece/async/ibiosim/gui/util/tabs/CloseTabPaneUI.java +++ b/gui/src/main/java/edu/utah/ece/async/ibiosim/gui/util/tabs/CloseTabPaneUI.java @@ -69,7 +69,7 @@ import javax.swing.plaf.basic.BasicTabbedPaneUI; import javax.swing.text.View; -import com.sun.java.swing.plaf.windows.WindowsIconFactory; +//import com.sun.java.swing.plaf.windows.WindowsIconFactory; import edu.utah.ece.async.ibiosim.gui.Gui; import edu.utah.ece.async.ibiosim.gui.ResourceManager;