Allow FPDFBookmark_GetFirstChild to return the top level bookmark
[pdfium.git] / fpdfsdk / src / formfiller / FFL_CBA_Fontmap.cpp
index 0c7cd48..8e10cc2 100644 (file)
@@ -239,14 +239,16 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString &sAlias)
        }
        
        CFX_ByteString sDA;
-       
-       sDA = FPDF_GetFieldAttr(m_pAnnotDict, "DA")->GetString();
+       CPDF_Object* pObj;
+       if ((pObj = FPDF_GetFieldAttr(m_pAnnotDict, "DA")))
+               sDA = pObj->GetString();
 
        if (bWidget)
        {
                if (sDA.IsEmpty())
                {
-                       sDA = FPDF_GetFieldAttr(pAcroFormDict, "DA")->GetString();      
+                       pObj = FPDF_GetFieldAttr(pAcroFormDict, "DA");
+                       sDA = pObj ? pObj->GetString() : CFX_ByteString();
                }
        }