Skip to content

Commit 14c6f88

Browse files
committed
PDFBOX-6061: avoid NPE as suggested by Jacobo Aragunde; closes #243
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1928232 13f79535-47bb-0310-9956-ffa450edef68
1 parent 9ab3188 commit 14c6f88

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ public COSName getKeyForValue(Object value)
105105
{
106106
Object nextValue = entry.getValue();
107107
if (nextValue.equals(value)
108-
|| (nextValue instanceof COSObject && ((COSObject) nextValue).getObject()
109-
.equals(value)))
108+
|| (nextValue instanceof COSObject &&
109+
!((COSObject) nextValue).isObjectNull() &&
110+
((COSObject) nextValue).getObject().equals(value)))
110111
{
111112
return entry.getKey();
112113
}

0 commit comments

Comments
 (0)