Fixed nullpointerexception in FileTree that resulted in bug when using

the collapse/expand hierachy in the project overview.
This commit is contained in:
LukasBuecherl 2021-04-14 14:44:40 -06:00
parent 8b24d5dd7c
commit d518ac2f46
2 changed files with 5 additions and 1 deletions

View file

@ -201,6 +201,9 @@ public class FileTree extends PanelObservable implements MouseListener {
}
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 class FileTree extends PanelObservable implements MouseListener {
i++;
}
}
}
});
tree.addMouseListener(this);
tree.addMouseListener(gui);

View file

@ -69,7 +69,7 @@ import javax.swing.plaf.basic.BasicHTML;
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;