happy-dom
happy-dom copied to clipboard
Problems with "parseCSSRules" function while running tests
Describe the bug Sometimes, on my stack the object extracted on "for of" loop is undefined and when the first if tries to access the "rule.type" key, the whole thing fails.
Expected behavior It suposed to have any validation on the object, just like you have done in this commit
Only adding the validation like rule && ...
works like charm
Can you provide a reproduction link? Easy to locate and troubleshoot problems.
I have looked at the code and I have a hard time to see how this could happen. A link or some more information would be great.