Skip to content

Commit c70f99c

Browse files
committed
Fix possible issue with NPE in PdfDictionaryEntrySet and PdfDictionaryValues.
DEVSIX-828
1 parent 78d7d91 commit c70f99c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

kernel/src/main/java/com/itextpdf/kernel/pdf/PdfDictionaryEntrySet.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public PdfName getKey() {
120120
@Override
121121
public PdfObject getValue() {
122122
PdfObject obj = entry.getValue();
123-
if (obj.isIndirectReference()) {
123+
if (obj != null && obj.isIndirectReference()) {
124124
obj = ((PdfIndirectReference) obj).getRefersTo(true);
125125
}
126126
return obj;

kernel/src/main/java/com/itextpdf/kernel/pdf/PdfDictionaryValues.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public boolean hasNext() {
119119
@Override
120120
public PdfObject next() {
121121
PdfObject obj = parentIterator.next();
122-
if (obj.isIndirectReference()) {
122+
if (obj != null && obj.isIndirectReference()) {
123123
obj = ((PdfIndirectReference) obj).getRefersTo(true);
124124
}
125125
return obj;

0 commit comments

Comments
 (0)