summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs/cfxjse_engine.cpp')
-rw-r--r--fxjs/cfxjse_engine.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/fxjs/cfxjse_engine.cpp b/fxjs/cfxjse_engine.cpp
index eb76ef1c57..e5d6c0a0fe 100644
--- a/fxjs/cfxjse_engine.cpp
+++ b/fxjs/cfxjse_engine.cpp
@@ -501,11 +501,12 @@ bool CFXJSE_Engine::RunVariablesScript(CXFA_Node* pScriptNode) {
if (!pTextNode)
return false;
- WideString wsScript;
- if (!pTextNode->JSNode()->TryCData(XFA_Attribute::Value, wsScript, true))
+ pdfium::Optional<WideString> wsScript =
+ pTextNode->JSNode()->TryCData(XFA_Attribute::Value, true);
+ if (!wsScript)
return false;
- ByteString btScript = wsScript.UTF8Encode();
+ ByteString btScript = wsScript->UTF8Encode();
auto hRetValue = pdfium::MakeUnique<CFXJSE_Value>(m_pIsolate);
CXFA_Node* pThisObject = pParent->GetNodeItem(XFA_NODEITEM_Parent);
CFXJSE_Context* pVariablesContext =