pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edi Weissmann (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-4230) NullpointerException in CmapSubtable
Date Thu, 24 May 2018 09:34:00 GMT

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

Edi Weissmann commented on PDFBOX-4230:
---------------------------------------

I could have easily fixed this myself and opened a pull request, but it seemed that pull requests
via GitHub is not how the project accepts contributions. Let me know if that's not the case,
and I can happily provide a PR.

> NullpointerException in CmapSubtable
> ------------------------------------
>
>                 Key: PDFBOX-4230
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4230
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.9
>            Reporter: Edi Weissmann
>            Priority: Major
>
> I'm seeing a *NullpointerException* in *CmapSubtable.java* at line *601*
> {{java.lang.NullPointerException at org.apache.fontbox.ttf.CmapSubtable.getGlyphId(CmapSubtable.java:601)}}
>  
> The cause seems to be that the *characterCodeToGlyphId* is not initialised by all code
paths.
>  
> The suggested fix would be to simply initialise the variable on declaration (line 48)
> {{private Map<Integer, Integer> characterCodeToGlyphId *= new HashMap<Integer,
Integer>()*;}}
>  
> Successfully tested this above suggested solution with a local build. 
> Sorry, cannot share the PDF doc causing this.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org


Mime
View raw message