Skip to content

Commit

Permalink
PDFBOX-5931: avoid NPE
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1922699 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
THausherr committed Dec 26, 2024
1 parent c95c3c6 commit 574ed48
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,12 @@ public int indexOfObject(COSBase object)
return i;
}
}
else if (item.equals(object)
|| item instanceof COSObject && ((COSObject) item).getObject().equals(object))
else if (item.equals(object))
{
return i;
}
else if (item instanceof COSObject && ((COSObject) item).getObject() != null &&
((COSObject) item).getObject().equals(object))
{
return i;
}
Expand Down

0 comments on commit 574ed48

Please sign in to comment.