report error getting user data in document.write

This commit is contained in:
Vincent Sanders 2015-10-05 21:53:43 +01:00
parent fbc3f36fb5
commit 6a4a7d7c25

View File

@ -32,9 +32,15 @@ method Document::write()
err = dom_node_get_user_data(priv->parent.node,
corestring_dom___ns_key_html_content_data,
&htmlc);
assert(htmlc != NULL);
if (err == DOM_NO_ERR && htmlc->parser != NULL) {
dom_hubbub_parser_insert_chunk(htmlc->parser, (uint8_t *)text, text_len);
if ((err == DOM_NO_ERR) &&
(htmlc != NULL) &&
(htmlc->parser != NULL)) {
dom_hubbub_parser_insert_chunk(htmlc->parser,
(uint8_t *)text,
text_len);
} else {
LOG("error getting htmlc. parent node:%p htmlc:%p",
priv->parent.node, htmlc);
}
return 0;
%}