Skip to content

NullPointerException for some invalid input #16

@ccreutzig

Description

@ccreutzig

Trying to use a selector like "a[b c d]", I get a NullPointerException, down in SelectorMatcher.matchesAttributeSelector:

@Test
public void testBadInput() {
    List<Node> nodes = new Selectors<>(document).querySelectorAll("div[id,foo]");
    assertEquals(0, nodes.size());

    nodes = new Selectors<>(document).querySelectorAll("div[id and foo]");
    assertEquals(0, nodes.size());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions