summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/Field.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/javascript/Field.cpp')
-rw-r--r--fpdfsdk/javascript/Field.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index 38309cfac5..937b3c6e61 100644
--- a/fpdfsdk/javascript/Field.cpp
+++ b/fpdfsdk/javascript/Field.cpp
@@ -229,8 +229,12 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument,
if (nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_TEXTFIELD) {
for (CPDFSDK_Widget* pWidget : widgets) {
FX_BOOL bFormatted = FALSE;
+ CPDFSDK_Widget::Observer observer(&pWidget);
CFX_WideString sValue = pWidget->OnFormat(bFormatted);
- pWidget->ResetAppearance(bFormatted ? sValue.c_str() : nullptr, FALSE);
+ if (pWidget) {
+ pWidget->ResetAppearance(bFormatted ? sValue.c_str() : nullptr,
+ FALSE);
+ }
}
} else {
for (CPDFSDK_Widget* pWidget : widgets) {