diff options
-rw-r--r-- | fpdfsdk/javascript/Field.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp index a89df16158..da0e60cc18 100644 --- a/fpdfsdk/javascript/Field.cpp +++ b/fpdfsdk/javascript/Field.cpp @@ -324,16 +324,21 @@ void Field::UpdateFormControl(CPDFSDK_FormFillEnvironment* pFormFillEnv, CPDFSDK_Widget* pWidget = pForm->GetWidget(pFormControl); if (pWidget) { + CPDFSDK_Widget::ObservedPtr observed_widget(pWidget); if (bResetAP) { int nFieldType = pWidget->GetFieldType(); if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD) { bool bFormatted = false; WideString sValue = pWidget->OnFormat(bFormatted); + if (!observed_widget) + return; pWidget->ResetAppearance(bFormatted ? &sValue : nullptr, false); } else { pWidget->ResetAppearance(nullptr, false); } + if (!observed_widget) + return; } if (bRefresh) { |