diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 4e47e72..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..00b41c6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +bin/ +.DS_Store diff --git a/VersionChecker/.DS_Store b/VersionChecker/.DS_Store deleted file mode 100644 index 1901893..0000000 Binary files a/VersionChecker/.DS_Store and /dev/null differ diff --git a/VersionChecker/src/versionchecker/actions/VCArtifactTable.java b/VersionChecker/src/versionchecker/actions/VCArtifactTable.java index ad3ae73..a7b0782 100644 --- a/VersionChecker/src/versionchecker/actions/VCArtifactTable.java +++ b/VersionChecker/src/versionchecker/actions/VCArtifactTable.java @@ -84,11 +84,15 @@ public void mouseClicked(MouseEvent e) { } public String getSelectedID() { - return this.selectedAF.getId(); + if (this.selectedAF != null) + return this.selectedAF.getId(); + return null; } public String getSelectedVer() { - return this.selectedAF.getVersion(); + if (this.selectedAF != null) + return this.selectedAF.getVersion(); + return null; } private void addEntry(VCArtifact toAdd) { diff --git a/VersionChecker/src/versionchecker/actions/VCMainWindow.java b/VersionChecker/src/versionchecker/actions/VCMainWindow.java index d660cd9..cce5bdc 100644 --- a/VersionChecker/src/versionchecker/actions/VCMainWindow.java +++ b/VersionChecker/src/versionchecker/actions/VCMainWindow.java @@ -11,6 +11,7 @@ import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JFrame; +import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; @@ -120,7 +121,10 @@ public void actionPerformed(ActionEvent event) { fetchButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { String id = tablePanel.getSelectedID(); - VCCloneTask task = new VCCloneTask(id,null); + if (id != null) + new VCCloneTask(id,null); + else + JOptionPane.showMessageDialog(null, "No component is selected.", "VersionChecker", 1);; } }); @@ -128,7 +132,10 @@ public void actionPerformed(ActionEvent event) { public void actionPerformed(ActionEvent event) { String id = tablePanel.getSelectedID(); String ver = tablePanel.getSelectedVer(); - VCCloneTask task = new VCCloneTask(id,ver); + if (id != null) + new VCCloneTask(id,ver); + else + JOptionPane.showMessageDialog(null, "No component is selected.", "VersionChecker", 1);; } });