Skip to content

Commit

Permalink
PDFBOX-5932: avoid NPE
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1922710 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Dec 27, 2024
1 parent 574ed48 commit 17519ff
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ private void collectLinkLocations() throws IOException

private void collectLinkLocation(PDAnnotationLink linkAnnotation) throws IOException
{
if (linkAnnotation.getRectangle() == null)
{
return;
}
PDAction action = linkAnnotation.getAction();
if (action instanceof PDActionURI)
{
Expand Down Expand Up @@ -209,7 +213,7 @@ private void collectFieldLocations() throws IOException
{
// 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());
}
Expand Down

0 comments on commit 17519ff

Please sign in to comment.