Closed nick-andren closed 9 years ago
I see. Since $nonexistent
doesn't have any elements, it's having trouble traversing the DOM tree for the next find. That does seem like something we should catch.
Found the issue. It's with an XPath optimization I did on IDs and classes. Working on a fix.
I think this is fixed now.
Hello,
First of all, thank you for QueryPath! It is really an awesome library.
I have noticed an issue where an exception is thrown when find() is executed multiple times on invalid elements. Here's an example:
This behaves as I would expect, where $myElement equals a QueryPath\DOMQuery object that returns a count() of 0.
It doesn't have to be 'input', but can be a class, attribute, or any other type of selector, except for an ID, from what I've seen. Given a similar example:
This throws the following error:
I would expect it to return an empty element like the other invalid selectors
I have tried this using QueryPath versions 3.0.3 and dev-master. Both behave the same way.