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

Unified Diff: fpdfsdk/fpdfformfill.cpp

Issue 2398063002: Fixup MSan embeddertests (Closed)
Patch Set: Created 4 years, 2 months 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 | « fpdfsdk/cpdfsdk_document.h ('k') | fpdfsdk/fpdfxfa/cpdfxfa_document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfformfill.cpp
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index 8be9d5f0b7e97fafb740f8be5b8323f486cee9fa..fd083c9dcd2ae463732c739455266bbe5dfa9f5f 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -277,7 +277,10 @@ FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) {
// XFA document.
if (CPDFSDK_Document* pSDKDoc = pEnv->GetSDKDocument()) {
pSDKDoc->ClearAllFocusedAnnots();
- pSDKDoc->GetXFADocument()->SetSDKDoc(nullptr);
+ // If the document was closed first, it's possible the XFA document
+ // is now a nullptr.
+ if (pSDKDoc->GetXFADocument())
+ pSDKDoc->GetXFADocument()->SetSDKDoc(nullptr);
}
#endif // PDF_ENABLE_XFA
« no previous file with comments | « fpdfsdk/cpdfsdk_document.h ('k') | fpdfsdk/fpdfxfa/cpdfxfa_document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698