lundi 4 avril 2016

Avoiding a Cannot read property 'get' of undefined error

When I run my code the console prints out an error message Cannot read property 'get' of undefined error. I thought an if statement would avoid this, but so far not luck. Here is my code

   if (records[0].get('StatusString') !== 'undefined') {
              creativeStatus = records[0].get('StatusString');
}

Aucun commentaire:

Enregistrer un commentaire