Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 983BC200BA3 for ; Thu, 20 Oct 2016 20:05:38 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 96F65160AE0; Thu, 20 Oct 2016 18:05:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D5880160ACC for ; Thu, 20 Oct 2016 20:05:37 +0200 (CEST) Received: (qmail 32810 invoked by uid 500); 20 Oct 2016 18:05:37 -0000 Mailing-List: contact commits-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list commits@pdfbox.apache.org Received: (qmail 32801 invoked by uid 99); 20 Oct 2016 18:05:37 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Oct 2016 18:05:37 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id A330BC198B for ; Thu, 20 Oct 2016 18:05:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id tbNq3zqKLfZr for ; Thu, 20 Oct 2016 18:05:36 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id F1A735F576 for ; Thu, 20 Oct 2016 18:05:35 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E0C32E0339 for ; Thu, 20 Oct 2016 18:05:33 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id DCBF03A0D2A for ; Thu, 20 Oct 2016 18:05:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1765854 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java Date: Thu, 20 Oct 2016 18:05:33 -0000 To: commits@pdfbox.apache.org From: tilman@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20161020180533.DCBF03A0D2A@svn01-us-west.apache.org> archived-at: Thu, 20 Oct 2016 18:05:38 -0000 Author: tilman Date: Thu Oct 20 18:05:33 2016 New Revision: 1765854 URL: http://svn.apache.org/viewvc?rev=1765854&view=rev Log: PDFBOX-3534: avoid NPE if AcroForm field's child cosdict is null, as suggested by Tim Allison Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java?rev=1765854&r1=1765853&r2=1765854&view=diff ============================================================================== --- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java (original) +++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDNonTerminalField.java Thu Oct 20 18:05:33 2016 @@ -133,10 +133,14 @@ public class PDNonTerminalField extends COSArray kids = (COSArray)getCOSObject().getDictionaryObject(COSName.KIDS); for (int i = 0; i < kids.size(); i++) { - PDField field = PDField.fromDictionary(getAcroForm(), (COSDictionary)kids.getObject(i), this); - if (field != null) + COSDictionary cosDict = (COSDictionary)kids.getObject(i); + if (cosDict != null) { - children.add(field); + PDField field = PDField.fromDictionary(getAcroForm(), cosDict, this); + if (field != null) + { + children.add(field); + } } } return children;