diff options
Diffstat (limited to 'src/html/html_tablerow_element.c')
-rw-r--r-- | src/html/html_tablerow_element.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/html/html_tablerow_element.c b/src/html/html_tablerow_element.c index fe7d929..1a6069b 100644 --- a/src/html/html_tablerow_element.c +++ b/src/html/html_tablerow_element.c @@ -20,7 +20,7 @@ #include "core/attr.h" #include "utils/utils.h" -static struct dom_element_protected_vtable _protect_vtable = { +static const struct dom_element_protected_vtable _protect_vtable = { { DOM_NODE_PROTECT_VTABLE_HTML_TABLE_ROW_ELEMENT }, @@ -244,16 +244,17 @@ dom_exception dom_html_table_row_element_get_row_index( return exp; } - exp = dom_html_table_section_element_get_rows(t_head, &rows); - dom_node_unref(t_head); - if (exp != DOM_NO_ERR) { - return exp; - } - - dom_html_collection_get_length(rows, &len); - dom_html_collection_unref(rows); + if (t_head != NULL) { + exp = dom_html_table_section_element_get_rows(t_head, &rows); + dom_node_unref(t_head); + if (exp != DOM_NO_ERR) { + return exp; + } - count += len; + dom_html_collection_get_length(rows, &len); + dom_html_collection_unref(rows); + count += len; + } for (n = n->first_child;n != parent && n != NULL; n = n->next) { |