jeremias 2003/03/12 00:02:05 Modified: src/java/org/apache/fop/svg PDFGraphics2D.java Log: Fix NPE when content of an <a> element is empty. Revision Changes Path 1.2 +10 -8 xml-fop/src/java/org/apache/fop/svg/PDFGraphics2D.java Index: PDFGraphics2D.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/PDFGraphics2D.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- PDFGraphics2D.java 11 Mar 2003 13:05:07 -0000 1.1 +++ PDFGraphics2D.java 12 Mar 2003 08:02:05 -0000 1.2 @@ -312,14 +312,16 @@ 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)); + } } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]