Skip to content

Commit

Permalink
Fix table empty crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
zjlywjh001 committed Jan 18, 2017
1 parent 0f9d22c commit 5d58fe8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/me/jarviswang/canomega/frames/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,9 @@ public void stateChanged(ChangeEvent e) {
mntmCopy = new JMenuItem("Copy to Clipboard");
mntmCopy.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (MainFrame.this.Logtable.getSelectedRow()<0) {
return ;
}
String ts = MainFrame.this.Logtable.getValueAt(MainFrame.this.Logtable.getSelectedRow(),0).toString();
String type = MainFrame.this.Logtable.getValueAt(MainFrame.this.Logtable.getSelectedRow(),1).toString();
if (type.toLowerCase().indexOf("receive")>=0) {
Expand All @@ -873,6 +876,9 @@ public void actionPerformed(ActionEvent e) {
mntmCopyToSender = new JMenuItem("Copy to Sender");
mntmCopyToSender.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (MainFrame.this.Logtable.getSelectedRow()<0) {
return ;
}
String id_str = MainFrame.this.Logtable.getValueAt(MainFrame.this.Logtable.getSelectedRow(),2).toString();
String id = id_str.substring(0, id_str.length()-1);
String dlc = MainFrame.this.Logtable.getValueAt(MainFrame.this.Logtable.getSelectedRow(),3).toString();
Expand Down

0 comments on commit 5d58fe8

Please sign in to comment.