diff options
| author | Nicolas Clapies <nclapies@entrouvert.com> | 2004-06-07 16:00:29 +0000 |
|---|---|---|
| committer | Nicolas Clapies <nclapies@entrouvert.com> | 2004-06-07 16:00:29 +0000 |
| commit | 0772620687676bd3fd35c87f7d77b52ac3a66606 (patch) | |
| tree | 23edf4b418627125b4fd2c029414e70c2346c4fa | |
| parent | 7d485dcda981e377a17f3a770d8e36a91990da67 (diff) | |
fix: segmentation fault in lasso_node_get_attr_value() if no attribute found
| -rw-r--r-- | lasso/xml/xml.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lasso/xml/xml.c b/lasso/xml/xml.c index 83b686e0..c31a3e4e 100644 --- a/lasso/xml/xml.c +++ b/lasso/xml/xml.c @@ -669,10 +669,15 @@ static xmlChar * lasso_node_impl_get_attr_value(LassoNode *node, const xmlChar *name) { + LassoAttr *prop; + g_return_val_if_fail (LASSO_IS_NODE(node), NULL); g_return_val_if_fail (name != NULL, NULL); - return (lasso_node_get_attr(node, name)->children->content); + prop = lasso_node_get_attr(node, name); + if(!prop) + return(NULL); + return (prop->children->content); } static GPtrArray * |
