Skip to content

Commit ffb050a

Browse files
committed
PDFBOX-5975: avoid ClassCastException, as suggested by Frans Bouwmans; remove super()
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1924491 13f79535-47bb-0310-9956-ffa450edef68
1 parent f4bfe47 commit ffb050a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDDestinationNameTreeNode.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public class PDDestinationNameTreeNode extends PDNameTreeNode<PDPageDestination>
3636
*/
3737
public PDDestinationNameTreeNode()
3838
{
39-
super();
4039
}
4140

4241
/**
@@ -60,7 +59,13 @@ protected PDPageDestination convertCOSToPD( COSBase base ) throws IOException
6059
//it for now
6160
destination = ((COSDictionary)base).getDictionaryObject( COSName.D );
6261
}
63-
return (PDPageDestination)PDDestination.create( destination );
62+
PDDestination dest = PDDestination.create(destination);
63+
if (dest instanceof PDPageDestination)
64+
{
65+
return (PDPageDestination) dest;
66+
}
67+
// PDFBOX-5975: invalid tree entry
68+
return null;
6469
}
6570

6671
@Override

0 commit comments

Comments
 (0)