From commits-return-13039-archive-asf-public=cust-asf.ponee.io@pdfbox.apache.org Fri Aug 31 16:52:20 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 8D4B5180663 for ; Fri, 31 Aug 2018 16:52:20 +0200 (CEST) Received: (qmail 77440 invoked by uid 500); 31 Aug 2018 14:52:19 -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 77431 invoked by uid 99); 31 Aug 2018 14:52:19 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Aug 2018 14:52:19 +0000 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 E0AD43A01AC for ; Fri, 31 Aug 2018 14:52:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1839761 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java Date: Fri, 31 Aug 2018 14:52:18 -0000 To: commits@pdfbox.apache.org From: tboehme@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20180831145218.E0AD43A01AC@svn01-us-west.apache.org> Author: tboehme Date: Fri Aug 31 14:52:18 2018 New Revision: 1839761 URL: http://svn.apache.org/viewvc?rev=1839761&view=rev Log: PDFBOX-4307: check object type before casting to COSDictionary in PDDocumentCatalog.getDocumentOutline Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java?rev=1839761&r1=1839760&r2=1839761&view=diff ============================================================================== --- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java (original) +++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDocumentCatalog.java Fri Aug 31 14:52:18 2018 @@ -160,8 +160,8 @@ public class PDDocumentCatalog implement */ public PDDocumentOutline getDocumentOutline() { - COSDictionary dict = (COSDictionary)root.getDictionaryObject(COSName.OUTLINES); - return dict == null ? null : new PDDocumentOutline(dict); + COSBase cosObj = root.getDictionaryObject(COSName.OUTLINES); + return cosObj instanceof COSDictionary ? new PDDocumentOutline((COSDictionary)cosObj) : null; } /**