Skip to content

Commit 17519ff

Browse files
committed
PDFBOX-5932: avoid NPE
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1922710 13f79535-47bb-0310-9956-ffa450edef68
1 parent 574ed48 commit 17519ff

File tree

1 file changed

+5
-1
lines changed
  • debugger/src/main/java/org/apache/pdfbox/debugger/pagepane

1 file changed

+5
-1
lines changed

debugger/src/main/java/org/apache/pdfbox/debugger/pagepane/PagePane.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ private void collectLinkLocations() throws IOException
149149

150150
private void collectLinkLocation(PDAnnotationLink linkAnnotation) throws IOException
151151
{
152+
if (linkAnnotation.getRectangle() == null)
153+
{
154+
return;
155+
}
152156
PDAction action = linkAnnotation.getAction();
153157
if (action instanceof PDActionURI)
154158
{
@@ -209,7 +213,7 @@ private void collectFieldLocations() throws IOException
209213
{
210214
// check if the annotation widget is on this page
211215
// (checking widget.getPage() also works, but it is sometimes null)
212-
if (dictionarySet.contains(widget.getCOSObject()))
216+
if (dictionarySet.contains(widget.getCOSObject()) && widget.getRectangle() != null)
213217
{
214218
rectMap.put(widget.getRectangle(), "Field name: " + field.getFullyQualifiedName());
215219
}

0 commit comments

Comments
 (0)