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

Unified Diff: fpdfsdk/src/javascript/Field.cpp

Issue 1487553003: Fix an assertion failure in CPDFSDK_Widget* Field::GetWidget() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/Field.cpp
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index 39e15e9868bb32fc7671442b8ee0104b6c9a8f3b..d3531a4aa3cdfa4d71a076af1206ae8ad19be96f 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -289,13 +289,9 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument,
CPDFSDK_Widget* Field::GetWidget(CPDFSDK_Document* pDocument,
CPDF_FormControl* pFormControl) {
- ASSERT(pDocument != NULL);
- ASSERT(pFormControl != NULL);
-
- CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
- ASSERT(pInterForm != NULL);
-
- return pInterForm->GetWidget(pFormControl);
+ CPDFSDK_InterForm* pInterForm =
+ static_cast<CPDFSDK_InterForm*>(pDocument->GetInterForm());
+ return pInterForm ? pInterForm->GetWidget(pFormControl) : nullptr;
}
FX_BOOL Field::ValueIsOccur(CPDF_FormField* pFormField,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698