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 2024/12/27 10:41:20 UTC
svn commit: r1922711 - /pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
Author: tilman
Date: Fri Dec 27 10:41:19 2024
New Revision: 1922711
URL: http://svn.apache.org/viewvc?rev=1922711&view=rev
Log:
PDFBOX-5932: avoid NPE
Modified:
pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
Modified: pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java?rev=1922711&r1=1922710&r2=1922711&view=diff
==============================================================================
--- pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java (original)
+++ pdfbox/branches/2.0/debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java Fri Dec 27 10:41:19 2024
@@ -133,6 +133,10 @@ public class PagePane implements ActionL
private void collectLinkLocation(PDAnnotationLink linkAnnotation) throws IOException
{
+ if (linkAnnotation.getRectangle() == null)
+ {
+ return;
+ }
PDAction action = linkAnnotation.getAction();
if (action instanceof PDActionURI)
{
@@ -195,7 +199,7 @@ public class PagePane implements ActionL
{
// check if the annotation widget is on this page
// (checking widget.getPage() also works, but it is sometimes null)
- if (dictionarySet.contains(widget.getCOSObject()))
+ if (dictionarySet.contains(widget.getCOSObject()) && widget.getRectangle() != null)
{
rectMap.put(widget.getRectangle(), "Field name: " + field.getFullyQualifiedName());
}