]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fix NPE when content of an <a> element is empty.
authorJeremias Maerki <jeremias@apache.org>
Wed, 12 Mar 2003 08:02:05 +0000 (08:02 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 12 Mar 2003 08:02:05 +0000 (08:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196072 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/svg/PDFGraphics2D.java

index 64fbdcfe9e6888ae612058137b64bd282224461a..241f0a316d2343d4aedc726cf5ce78d11510cadd 100644 (file)
@@ -312,14 +312,16 @@ public class PDFGraphics2D extends AbstractGraphics2D {
         AffineTransform at = getTransform();
         Shape b = at.createTransformedShape(bounds);
         b = trans.createTransformedShape(b);
-        Rectangle rect = b.getBounds();
-
-        if (linkType != PDFLink.EXTERNAL) {
-            String pdfdest = "/FitR " + dest;
-            resourceContext.addAnnotation(pdfDoc.makeLink(rect, pageRef, pdfdest));
-        } else {
-            resourceContext.addAnnotation(pdfDoc.makeLink(rect,
-                                                 dest, linkType, 0));
+        if (b != null) {
+            Rectangle rect = b.getBounds();
+    
+            if (linkType != PDFLink.EXTERNAL) {
+                String pdfdest = "/FitR " + dest;
+                resourceContext.addAnnotation(pdfDoc.makeLink(rect, pageRef, pdfdest));
+            } else {
+                resourceContext.addAnnotation(pdfDoc.makeLink(rect,
+                                                     dest, linkType, 0));
+            }
         }
     }