[ 
https://issues.apache.org/jira/browse/BATIK-1278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17400336#comment-17400336
 ] 

Stefan Mandel commented on BATIK-1278:
--------------------------------------

The NPE hides the real exception (something related to CSS) and occurs because 
toString is invoked on uri (which cannot be assumed non-null). The source code 
of CSS-Engine already contains nullchecks of the type uri == null? 
"<unknown>":uri.toString(). It would be easy to replace it at 
CSSEngine.java:1223

> W3C example image, parseStyleSheet nullpointer
> ----------------------------------------------
>
>                 Key: BATIK-1278
>                 URL: https://issues.apache.org/jira/browse/BATIK-1278
>             Project: Batik
>          Issue Type: Bug
>          Components: CSS
>    Affects Versions: 1.12
>            Reporter: Koen De Groote
>            Priority: Minor
>         Attachments: Use04-GeneratedContent.svg, Use04.svg
>
>
> Possible duplicate of https://issues.apache.org/jira/browse/BATIK-1163
>  
> Example image from here: [https://www.w3.org/TR/SVG11/struct.html]
>  
> Specifically, example "Example Use04": 
> [https://www.w3.org/TR/SVG11/images/struct/Use04.svg]
>  
> Stacktrace:
>  
> {code:java}
> java.lang.NullPointerException: null
>  at org.apache.batik.css.engine.CSSEngine.parseStyleSheet(CSSEngine.java:1223)
>  at org.apache.batik.css.engine.CSSEngine.parseStyleSheet(CSSEngine.java:1204)
>  at 
> org.apache.batik.anim.dom.SVGOMStyleElement.getCSSStyleSheet(SVGOMStyleElement.java:140)
>  at 
> org.apache.batik.css.engine.CSSEngine.getStyleSheetNodes(CSSEngine.java:923)
>  at 
> org.apache.batik.css.engine.CSSEngine.getCascadedStyleMap(CSSEngine.java:785)
>  at org.apache.batik.css.engine.CSSEngine.getComputedStyle(CSSEngine.java:867)
>  at 
> org.apache.batik.bridge.CSSUtilities.getComputedStyle(CSSUtilities.java:81)
>  at 
> org.apache.batik.bridge.CSSUtilities.convertVisibility(CSSUtilities.java:578)
>  at 
> org.apache.batik.bridge.SVGSVGElementBridge.createGraphicsNode(SVGSVGElementBridge.java:141)
>  at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:76)
>  at 
> org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:208)
>  at 
> org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:92)
>  at 
> org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)
>  at 
> org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156){code}
>  I've uploaded the image for easy access. Also uploaded is a nearly identical 
> example from the same page, that doesn't produce this nullpointer.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscr...@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-h...@xmlgraphics.apache.org

Reply via email to