malchata/yall.js

Type error when dataset is undefined.

radfahrer opened this issue · 0 comments

We're seeing some issues in our error reporting "Cannot use 'in' operator to search for 'srcset' in undefined"

It looks like it's happening here:

if (dataAttrs[dataAttrIndex] in element.dataset) {

I'm guessing that whatever "element" is getting passed in doesn't have a dataset. Should be a simple check to add in before trying to flip attributes to check if there is a dataset.