summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpdfsdk/cpdfsdk_widgethandler.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/fpdfsdk/cpdfsdk_widgethandler.cpp b/fpdfsdk/cpdfsdk_widgethandler.cpp
index 1e63f5ecc6..c34f766793 100644
--- a/fpdfsdk/cpdfsdk_widgethandler.cpp
+++ b/fpdfsdk/cpdfsdk_widgethandler.cpp
@@ -229,7 +229,11 @@ void CPDFSDK_WidgetHandler::OnLoad(CPDFSDK_Annot* pAnnot) {
int nFieldType = pWidget->GetFieldType();
if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX) {
bool bFormatted = false;
+ CPDFSDK_Annot::ObservedPtr pObserved(pWidget);
CFX_WideString sValue = pWidget->OnFormat(bFormatted);
+ if (!pObserved)
+ return;
+
if (bFormatted && nFieldType == FIELDTYPE_COMBOBOX)
pWidget->ResetAppearance(&sValue, false);
}