Menu

#62 Exception when nth-child is not properly specified

closed
nobody
None
1
2015-02-11
2014-11-15
mercury
No

Encountered this erroneous CSS rule:

div:nth-child {background: red}

The parameter to nth-child is missing and throws an exception:

java.lang.NullPointerException
    at cz.vutbr.web.csskit.SelectorImpl$PseudoPageImpl.positionMatches(SelectorImpl.java:509)
    at cz.vutbr.web.csskit.SelectorImpl$PseudoPageImpl.matches(SelectorImpl.java:470)
    at cz.vutbr.web.csskit.SelectorImpl.matches(SelectorImpl.java:115)
    at cz.vutbr.web.domassign.Analyzer.elementSelectorMatches(Analyzer.java:324)
    at cz.vutbr.web.domassign.DirectAnalyzer.matchSelector(DirectAnalyzer.java:206)
    at cz.vutbr.web.domassign.DirectAnalyzer.getDeclarationsForElement(DirectAnalyzer.java:156)
    at cz.vutbr.web.domassign.DirectAnalyzer.getElementStyle(DirectAnalyzer.java:73)
    at cz.vutbr.web.domassign.DirectAnalyzer.getElementStyle(DirectAnalyzer.java:91)

Discussion

  • Radek Burget

    Radek Burget - 2014-12-17

    Ok, hopefully fixed by this commit .

     
  • mercury

    mercury - 2014-12-18

    Added a test-case for this: https://github.com/radkovo/jStyleParser/pull/10

    ... and verified that your commit fixes it.

     
  • Radek Burget

    Radek Burget - 2015-01-10
    • status: open --> accepted
     
  • Radek Burget

    Radek Burget - 2015-02-11
    • status: accepted --> closed
     
  • Radek Burget

    Radek Burget - 2015-02-11

    Closed in 1.20.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.