diff options
-rw-r--r-- | src/html/html_tablerow_element.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/html/html_tablerow_element.c b/src/html/html_tablerow_element.c index fe7d929..569e70f 100644 --- a/src/html/html_tablerow_element.c +++ b/src/html/html_tablerow_element.c @@ -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) { |