Changeset 140 in tmcsimulator-scriptbuilder for trunk/src/event/editor/ParamicsPanel.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/ParamicsPanel.java

    r130 r140  
    9696    public void uponClose() 
    9797    { 
    98         event.locationID = LocationDropdown.getSelectedItem().toString(); 
    99         event.status = StatusDropdown.getSelectedItem().toString(); 
    100         event.type = TypeDropdown.getSelectedItem().toString(); 
    101         for (JCheckBox lane : lanes) 
    102         { 
    103             lane.getActionListeners()[0].actionPerformed(new ActionEvent(lane, 0, "record")); 
     98        if (event != null) 
     99        { 
     100            event.locationID = LocationDropdown.getSelectedItem().toString(); 
     101            event.status = StatusDropdown.getSelectedItem().toString(); 
     102            event.type = TypeDropdown.getSelectedItem().toString(); 
     103            for (JCheckBox lane : lanes) 
     104            { 
     105                lane.getActionListeners()[0].actionPerformed(new ActionEvent(lane, 0, "record")); 
     106            } 
    104107        } 
    105108    } 
Note: See TracChangeset for help on using the changeset viewer.