Changeset 42 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder/structures/events/RadioEvaluationEvent.java


Ignore:
Timestamp:
08/07/2017 12:57:39 PM (9 years ago)
Author:
bmcguffin
Message:

Fixed a bug which caused null evaluation events to be improperly translated to text.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/events/RadioEvaluationEvent.java

    r38 r42  
    44 * and open the template in the editor. 
    55 */ 
    6  
    76package scriptbuilder.structures.events; 
    87 
     
    2423        super(ScriptEventType.RADIO_EVAL_EVENT); 
    2524    } 
    26      
     25 
    2726    public ArrayList<String> expectedAction = new ArrayList<String>(); 
    28      
     27 
    2928    @Override 
    3029    public ArrayList<String> getExpectedActions() 
     
    3231        return expectedAction; 
    3332    } 
    34      
     33 
    3534    @Override 
    3635    public void addAction(String act) 
     
    4443        expectedAction.set(index, act); 
    4544    } 
    46      
     45 
    4746    @Override 
    4847    public void removeAction(int index) 
     
    5554    { 
    5655        String output = openTag(ELEMENT.RADIO_EVALUATION.tag); 
    57         for (String str : expectedAction) 
     56        if (expectedAction != null) 
    5857        { 
    59             output += openTag(ELEMENT.EXPECTED_ACTION.tag); 
    60             output += str; 
    61             output += closeTag(ELEMENT.EXPECTED_ACTION.tag); 
     58            for (String str : expectedAction) 
     59            { 
     60                if (str == null) 
     61                { 
     62                    str = ""; 
     63                } 
     64                output += openTag(ELEMENT.EXPECTED_ACTION.tag); 
     65                output += str; 
     66                output += closeTag(ELEMENT.EXPECTED_ACTION.tag); 
     67            } 
    6268        } 
    6369        output += closeTag(ELEMENT.RADIO_EVALUATION.tag); 
    64          
     70 
    6571        return output; 
    6672    } 
Note: See TracChangeset for help on using the changeset viewer.