Fix Uncaught TypeError: Cannot read property 'length' of undefined

Fix Uncaught TypeError: Cannot read property 'length' of undefined
Merge pull request #289 from MaxMorais/patch-1

[minor] Fix Uncaught TypeError: Cannot read property 'length' of undefined