Skip to content

Commit

Permalink
Fix getDirect in COSIndirect
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximPlusov committed Oct 18, 2024
1 parent 9a21858 commit ee4eb2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/verapdf/cos/COSIndirect.java
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,10 @@ private COSObject getChildObject() {
@Override
public COSObject getDirect() {
COSObject object = getChildObject();
if (object.isIndirect()) {
if (Boolean.TRUE.equals(object.isIndirect())) {
Set<COSKey> keys = new HashSet<>();
keys.add(getObjectKey());
while (object.isIndirect()) {
while (Boolean.TRUE.equals(object.isIndirect())) {
COSKey key = object.getObjectKey();
if (keys.contains(key)) {
throw new LoopedException("Loop in indirect references starting from indirect object " + getObjectKey());
Expand Down

0 comments on commit ee4eb2e

Please sign in to comment.