fix serialization segfault

Fix segfault if doctype hasn't attribute
This commit is contained in:
Кирилл Жумарин 2018-06-02 01:10:26 +03:00 committed by GitHub
parent 578bedb548
commit d41f529335
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,7 +140,7 @@ mystatus_t myhtml_serialization_node_callback(myhtml_tree_node_t* node, mycore_c
if(node->token) {
myhtml_tree_attr_t* attr = node->token->attr_first;
if(attr->key.data && attr->key.length) {
if(attr && attr->key.data && attr->key.length) {
if(callback(" ", 1, ptr))
return MyCORE_STATUS_ERROR_MEMORY_ALLOCATION;