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

Philipp Koch commented on PDFBOX-743:
-------------------------------------

> . Should getNormalAppearance() return null in this case? 
i would say yes, BUT one has to make sure that all callers can handle the NULL 
value (see PageDrawer line 127)

> 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