You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2016/02/25 19:09:37 UTC

svn commit: r1732335 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationMarkup.java

Author: tilman
Date: Thu Feb 25 18:09:36 2016
New Revision: 1732335

URL: http://svn.apache.org/viewvc?rev=1732335&view=rev
Log:
PDFBOX-3249: return null instead of throwing exception, as suggested by David Lattimore

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationMarkup.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationMarkup.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationMarkup.java?rev=1732335&r1=1732334&r2=1732335&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationMarkup.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAnnotationMarkup.java Thu Feb 25 18:09:36 2016
@@ -213,16 +213,20 @@ public class PDAnnotationMarkup extends
     }
 
     /**
-     * This will retrieve the annotation to which this one is "In Reply To" the actual relationship is specified by the
-     * RT entry.
+     * This will retrieve the annotation to which this one is "In Reply To" the actual relationship
+     * is specified by the RT entry.
      *
-     * @return the other annotation.
-     * @throws IOException if there is an error with the annotation.
+     * @return the other annotation or null if there is none.
+     * @throws IOException if there is an error creating the other annotation.
      */
     public PDAnnotation getInReplyTo() throws IOException
     {
-        COSBase irt = getCOSObject().getDictionaryObject("IRT");
-        return PDAnnotation.createAnnotation(irt);
+        COSBase base = getCOSObject().getDictionaryObject("IRT");
+        if (base instanceof COSDictionary)
+        {
+            return PDAnnotation.createAnnotation(base);
+        }
+        return null;
     }
 
     /**