Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2458)

Unified Diff: core/src/fpdfdoc/doc_ap.cpp

Issue 396173003: Adjust null object check (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: clean up Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/src/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_ap.cpp
diff --git a/core/src/fpdfdoc/doc_ap.cpp b/core/src/fpdfdoc/doc_ap.cpp
index 6a8ab374d21e7150339d2f4258977eef8b25c6d6..0e2a75ad2c90f7f9ff2013370a12234aacbdd54b 100644
--- a/core/src/fpdfdoc/doc_ap.cpp
+++ b/core/src/fpdfdoc/doc_ap.cpp
@@ -253,7 +253,10 @@ static FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict
if (!pFormDict) {
return FALSE;
}
- CFX_ByteString DA = FPDF_GetFieldAttr(pAnnotDict, "DA") ? FPDF_GetFieldAttr(pAnnotDict, "DA")->GetString() : CFX_ByteString();
+ CFX_ByteString DA;
+ if (CPDF_Object* pDAObj = FPDF_GetFieldAttr(pAnnotDict, "DA")) {
+ DA = pDAObj->GetString();
+ }
if (DA.IsEmpty()) {
DA = pFormDict->GetString("DA");
}
« no previous file with comments | « no previous file | core/src/fpdfdoc/doc_formfield.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698