You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Got an error in production on TermColorKeywordImpl.toString
Caused by: java.lang.NullPointerException
at cz.vutbr.web.csskit.TermColorKeywordImpl.toString(TermColorKeywordImpl.java:36)
at cz.vutbr.web.csskit.antlr4.CSSParserVisitorImpl.visitValuepart(CSSParserVisitorImpl.java:996)
at cz.vutbr.web.csskit.antlr4.CSSParserVisitorImpl.visitTermValuePart(CSSParserVisitorImpl.java:854)
at cz.vutbr.web.csskit.antlr4.CSSParserVisitorImpl.visitTerms(CSSParserVisitorImpl.java:821)
at cz.vutbr.web.csskit.antlr4.CSSParserVisitorImpl.visitDeclaration(CSSParserVisitorImpl.java:730)
at cz.vutbr.web.csskit.antlr4.CSSParserVisitorImpl.visitDeclarations(CSSParserVisitorImpl.java:691)
at cz.vutbr.web.csskit.antlr4.CSSParserVisitorImpl.visitRuleset(CSSParserVisitorImpl.java:668)
at cz.vutbr.web.csskit.antlr4.CSSParserVisitorImpl.visitStatement(CSSParserVisitorImpl.java:282)
at cz.vutbr.web.csskit.antlr4.CSSParserVisitorImpl.visitStylesheet(CSSParserVisitorImpl.java:241)
at cz.vutbr.web.csskit.antlr4.CSSParserFactory.parse(CSSParserFactory.java:206)
at cz.vutbr.web.csskit.antlr4.CSSParserFactory.parseAndImport(CSSParserFactory.java:147)
at cz.vutbr.web.csskit.antlr4.CSSParserFactory.parse(CSSParserFactory.java:72)
at cz.vutbr.web.csskit.antlr4.CSSParserFactory.parse(CSSParserFactory.java:93)
at cz.vutbr.web.css.CSSFactory.parseString(CSSFactory.java:546)
at cz.vutbr.web.css.CSSFactory.parseString(CSSFactory.java:521)
We are still on version 3.2, but the interested code looks the same (the code at CSSParserVisitorImpl.java:996 was moved in a new method CSSParserVisitorImpl#findSpecificType but the code is actually the same).
We couldn't reproduce the error and it seems that TermColorKeywordImpl#keyword should never be null.
I'll submit a pull request adding some ifs around debug statements. This won't solve the root problem but will avoid a crash on a debug statement (and avoid some string allocation).
The text was updated successfully, but these errors were encountered:
dmercuriali
added a commit
to dmercuriali/jStyleParser
that referenced
this issue
May 31, 2019
The problem seems to be somewhere in the parser code (e.g. CSSParserVisitorImpl). The parser implementation has changed significantly in the last release. I suggest the following approach (which should be always used when reporting a bug in any project):
First, verify whether the bug is still present in the latest release (jStyleParser 3.3).
If yes, try to reproduce the bug: in this case, try to find the CSS code that causes the NPE.
Then, report the issue with the related information attached and/or create a PR that fixes the bug in its origin.
Got an error in production on TermColorKeywordImpl.toString
We are still on version 3.2, but the interested code looks the same (the code at CSSParserVisitorImpl.java:996 was moved in a new method CSSParserVisitorImpl#findSpecificType but the code is actually the same).
We couldn't reproduce the error and it seems that TermColorKeywordImpl#keyword should never be null.
I'll submit a pull request adding some ifs around debug statements. This won't solve the root problem but will avoid a crash on a debug statement (and avoid some string allocation).
The text was updated successfully, but these errors were encountered: