Chromium Code Reviews| Index: fpdfsdk/src/javascript/Field.cpp |
| diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp |
| index 39e15e9868bb32fc7671442b8ee0104b6c9a8f3b..40af4103e2c637f13fa9512f783e9bdd9c4b4419 100644 |
| --- a/fpdfsdk/src/javascript/Field.cpp |
| +++ b/fpdfsdk/src/javascript/Field.cpp |
| @@ -289,13 +289,10 @@ 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); |
| + ASSERT(pDocument); |
|
Tom Sepez
2015/11/30 17:19:11
Nit: we can remove this assert because pDocument->
jun_fang
2015/12/01 04:30:12
Acknowledged.
|
| + CPDFSDK_InterForm* pInterForm = |
| + static_cast<CPDFSDK_InterForm*>(pDocument->GetInterForm()); |
| + return pInterForm ? pInterForm->GetWidget(pFormControl) : nullptr; |
| } |
| FX_BOOL Field::ValueIsOccur(CPDF_FormField* pFormField, |