summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmlparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/xml/cfx_xmlparser.cpp')
-rw-r--r--core/fxcrt/xml/cfx_xmlparser.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/core/fxcrt/xml/cfx_xmlparser.cpp b/core/fxcrt/xml/cfx_xmlparser.cpp
index dd28cf8adc..094daac889 100644
--- a/core/fxcrt/xml/cfx_xmlparser.cpp
+++ b/core/fxcrt/xml/cfx_xmlparser.cpp
@@ -518,12 +518,10 @@ void CFX_XMLParser::ProcessTargetData() {
WideString target_data = GetTextData();
if (target_data.IsEmpty())
return;
- if (!current_node_)
- return;
- if (current_node_->GetType() != FX_XMLNODE_Instruction)
- return;
- static_cast<CFX_XMLInstruction*>(current_node_)->AppendData(target_data);
+ CFX_XMLInstruction* instruction = ToXMLInstruction(current_node_);
+ if (instruction)
+ instruction->AppendData(target_data);
}
WideString CFX_XMLParser::GetTextData() {