webdriverio-boneyard / wdio-sync

A WebdriverIO v4 plugin. Helper module to run WebdriverIO commands synchronously.
http://v4.webdriver.io
MIT License
17 stars 31 forks source link

Don't crash when webdriverio.getAttribute returns an array of null #44

Closed NiGhTTraX closed 7 years ago

NiGhTTraX commented 7 years ago

Fixes #43.

christian-bromann commented 7 years ago

There is no reason do this double check:

result.length && result[0]
timruffles commented 6 years ago

@christian-bromann @NiGhTTraX 's intention was to avoid a runtime exception in the case of arrays like [undefined] or [null]. Checking the array's length is > 0 is insufficient, as the PR's title states.