Fix two issues shown by bug 489995
[pdfium.git] / core / src / fpdfapi / fpdf_parser / fpdf_parser_utility.cpp
index 9e14341..63454d2 100644 (file)
@@ -410,7 +410,7 @@ CFX_ByteTextBuf& operator<<(CFX_ByteTextBuf& buf, const CPDF_Object* pObj) {
         CFX_ByteString key;
         CPDF_Object* pValue = p->GetNextElement(pos, key);
         buf << FX_BSTRC("/") << PDF_NameEncode(key);
-        if (pValue->GetObjNum()) {
+        if (pValue && pValue->GetObjNum()) {
           buf << " " << pValue->GetObjNum() << FX_BSTRC(" 0 R ");
         } else {
           buf << pValue;