-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$(undefined).prop('href') throws error #875
Comments
Seems like the problem is here? |
@sotojuan, if you are interested in taking over then go ahead. |
It should be relatively easy to fix, no? If |
Is it related to #554? |
Sort of, jQuery creates the element even if the attribute value is undefined, and cheerio doesn't. |
I add some background info. The bug might also be triggered when the selector does not match, like in the code: $('.not-exists').attr('href') It was not enough to check that Looking through the current Cheerio tests, it does not seem to consider negative cases when some input is undefiend or null. |
Fixed in #880 |
$(undefined).prop('href')
throws:With jQuery the same expression returns
undefined
.Tested with Cheerio 0.20.0
The text was updated successfully, but these errors were encountered: