You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/02/11 19:15:13 UTC
[jira] [Commented] (PDFBOX-2678) possible NPE in ExtractText tool
of trunk
[ https://issues.apache.org/jira/browse/PDFBOX-2678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14316686#comment-14316686 ]
ASF subversion and git services commented on PDFBOX-2678:
---------------------------------------------------------
Commit 1659023 from [~tilman] in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1659023 ]
PDFBOX-2678: avoid NPE risk discovered by user "nullpointer"
> possible NPE in ExtractText tool of trunk
> -----------------------------------------
>
> Key: PDFBOX-2678
> URL: https://issues.apache.org/jira/browse/PDFBOX-2678
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 1.8.8, 1.8.9, 2.0.0
> Reporter: nullpointer
> Assignee: Tilman Hausherr
> Priority: Minor
> Fix For: 1.8.9, 2.0.0
>
> Original Estimate: 5m
> Remaining Estimate: 5m
>
> With some PDFs an NPE is thrown.
> Here's the patch for it (referring to trunk):
> {code:java}
> Index: tools/src/main/java/org/apache/pdfbox/tools/ExtractText.java
> ===================================================================
> --- tools/src/main/java/org/apache/pdfbox/tools/ExtractText.java (Revision 1658905)
> +++ tools/src/main/java/org/apache/pdfbox/tools/ExtractText.java (Working Copy)
> @@ -252,7 +252,7 @@
> }
> PDComplexFileSpecification spec = (PDComplexFileSpecification) ent.getValue();
> PDEmbeddedFile file = spec.getEmbeddedFile();
> - if (file != null && file.getSubtype().equals("application/pdf"))
> + if (file != null && file.getSubtype() != null && file.getSubtype().equals("application/pdf"))
> {
> if (debug)
> {
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org