Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in 1.2.2-beta1 when parsing SVG document #59

Open
GoogleCodeExporter opened this issue Jun 11, 2015 · 4 comments
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Parse a SVG document (from a String, but I don't think this matters)
2. Receive a NullPointerException
3.

What is the expected output? What do you see instead?
Version 1.2.1 parses this same SVG document fine. On version 1.2.2-beta1 (with 
the same exact SVG), I get a NPE;
java.lang.NullPointerException
at com.caverock.androidsvg.SVGParser.parseFont(SVGParser.java:3253)
at com.caverock.androidsvg.SVGParser.processStyleProperty(SVGParser.java:2478)
at com.caverock.androidsvg.SVGParser.parseAttributesStyle(SVGParser.java:2363)
at com.caverock.androidsvg.SVGParser.text(SVGParser.java:1238)
at com.caverock.androidsvg.SVGParser.startElement(SVGParser.java:470)
at org.apache.harmony.xml.ExpatParser.startElement(ExpatParser.java:143)
at org.apache.harmony.xml.ExpatParser.appendBytes(Native Method)
at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:513)
at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:474)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:316)
at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:279)
at com.caverock.androidsvg.SVGParser.parse(SVGParser.java:394)
at com.caverock.androidsvg.SVG.getFromString(SVG.java:158)

What version of the product are you using? On what operating system?
1.2.2-beta1 on Android (I tried this on 4.4.4 and 5.1).

Please provide any additional information below.
The SVG document is not publicly available, but I can get you the String for it 
if required.

Original issue reported on code.google.com by [email protected] on 30 Apr 2015 at 7:53

@GoogleCodeExporter
Copy link
Author

From what I can tell in reading the code, it appears that 
initialiseFontWeightKeywordsMap() is not being called before the parseFont call.

Original comment by [email protected] on 30 Apr 2015 at 7:54

@GoogleCodeExporter
Copy link
Author

Are you able to provide a sample SVG that reproduces the problem?

That code has been refactored somewhat in my local copy, so it may have been 
fixed already anyway.

Original comment by [email protected] on 1 May 2015 at 2:26

@GoogleCodeExporter
Copy link
Author

You bet! I'll capture one of the failing documents today and attach it to this 
issue. Thanks for looking into it, I appreciate it.

Original comment by [email protected] on 1 May 2015 at 5:45

@GoogleCodeExporter
Copy link
Author

Hi Paul, here are a couple of documents that are both failing with the same 
stack trace on 1.2.2-beta-1. Thanks again for checking it out!

Original comment by [email protected] on 1 May 2015 at 9:09

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant