From 6a4a7d7c254bf509bb392bf97abd8eb89c95ace5 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 5 Oct 2015 21:53:43 +0100 Subject: [PATCH] report error getting user data in document.write --- javascript/duktape/Document.bnd | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/javascript/duktape/Document.bnd b/javascript/duktape/Document.bnd index 897019fb3..7130511a1 100644 --- a/javascript/duktape/Document.bnd +++ b/javascript/duktape/Document.bnd @@ -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; %}