Changeset 140 in tmcsimulator-scriptbuilder for trunk/src/event/editor/CMSEvaluationPanel.java


Ignore:
Timestamp:
12/22/2017 02:05:13 PM (8 years ago)
Author:
bmcguffin
Message:

Fixed defect #67. Removing an event and then closing the event editor window no longer causes the program to hang; a null check for the event is encountered before taking action upon close of the window.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/event/editor/CMSEvaluationPanel.java

    r130 r140  
    3535        event = (CMSEvaluationEvent) sei; 
    3636        txtID.setText(event.cmsID); 
    37          
     37 
    3838        txtLocation.setText(event.location); 
    39          
     39 
    4040        txtMessage.setText(""); 
    4141        for (int i = 0; i < event.message.size(); i++) 
     
    5050            } 
    5151        } 
    52          
     52 
    5353        addButton.addActionListener(new ActionListener() 
    5454        { 
     
    8282        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. 
    8383    } 
    84      
     84 
    8585    @Override 
    8686    public boolean removeAssociatedEvent() 
     
    9494    public void uponClose() 
    9595    { 
    96         event.cmsID = txtID.getText(); 
    97         event.location = txtLocation.getText(); 
    98         event.cmsType = TypeDropdown.getSelectedItem().toString(); 
     96        if (event != null) 
     97        { 
     98            event.cmsID = txtID.getText(); 
     99            event.location = txtLocation.getText(); 
     100            event.cmsType = TypeDropdown.getSelectedItem().toString(); 
     101        } 
    99102    } 
    100103 
Note: See TracChangeset for help on using the changeset viewer.