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

Johannes Koch commented on PDFBOX-743:
--------------------------------------

According to PDF 32000-1:2008 (PDF 1.7), table 168, page 389, the N entry is 
required in an appearance dictionary. So an appearance dictionary without an N 
entry is erroneous. Should getNormalAppearance() return null in this case?

> PDAppereanceDictionary#getNormalAppearance might throw NPE
> ----------------------------------------------------------
>
>                 Key: PDFBOX-743
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-743
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 1.1.0
>            Reporter: Philipp Koch
>             Fix For: 1.2.0
>
>
> following code patch will ensure that no NPE is thrown. the question is if 
> the check for NULL is done at the correct place (functionally yes) 
> respectively is it correct to apply the default configuration setting for 
> that case?
> @@ -85,7 +85,7 @@
>      public Map getNormalAppearance()
>      {
>          COSBase ap = dictionary.getDictionaryObject( COSName.getPDFName( "N" 
> ) );
> -        if( ap instanceof COSStream )
> +        if( ap instanceof COSStream || ap == null)
>          {
>              COSStream aux = (COSStream) ap;
>              ap = new COSDictionary();

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to