2 Replies Latest reply on Nov 15, 2010 7:25 AM by majester8425

    My event.result may or may not return a node within the xml. How can I stop TypeError: Error #1009:

    majester8425 Level 1

      My event.result may or may not return a node within the xml. How can I stop TypeError: Error #1009: Cannot access a property or method of a null object reference.

       

       

      I have a very simple issue. I want to take the value of

       

      event.result.item.nodeindex1.nodeindex2.row.myvalue;

       

      and assign it to a text field

       

      mytextTi.text = event.result.item.nodeindex1.nodeindex2.row.myvalue;

       

       

      But if any of the tree is missing, which is also valid then I get TypeError: Error #1009: Cannot access a property or method of a null object reference.

       

       

      I have tried various solutions such as the following. Is there no simple way to do this ?

       

      If (event.result.item.nodeindex1.nodeindex2.row.myvalue != undefined) – Does not work