Forum Discussion

elesniewski's avatar
elesniewski
Occasional Contributor
7 years ago

TypeError: Cannot read property 'push' of null .. well, sometimes

I have a scenario where I setup a variable of Type Object with Default value: {Object variable [unassigned]} This will be populated with an array of sql query output.  On first run of the test, the...
  • elesniewski's avatar
    elesniewski
    7 years ago

    That works, too, but, to solve this issue I found I needed to change the following:

     

    if (KeywordTests.Main.Variables.ourArray != null)

    change to:
    if (KeywordTests.Main.Variables.ourArray != '')

     If I use null here, an empty string is passed to the sql query, causing the syntax error.  If I use '' instead of null, no worries.   Thanks.