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

    r130 r140  
    9494    public void uponClose() 
    9595    { 
    96         event.unitNum = txtUnitNumber.getText(); 
    97         event.unitActive = ActiveDropdown.getSelectedItem().toString(); 
    98         event.unitPrimary = PrimaryDropdown.getSelectedItem().toString(); 
    99         event.unitStatus = StatusDropdown.getSelectedItem().toString(); 
     96        if (event != null) 
     97        { 
     98            event.unitNum = txtUnitNumber.getText(); 
     99            event.unitActive = ActiveDropdown.getSelectedItem().toString(); 
     100            event.unitPrimary = PrimaryDropdown.getSelectedItem().toString(); 
     101            event.unitStatus = StatusDropdown.getSelectedItem().toString(); 
     102        } 
    100103    } 
    101104 
Note: See TracChangeset for help on using the changeset viewer.