projects
/
libcxml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6dd54f6
)
Use exceptions to report calls to Node with _node == 0.
author
Carl Hetherington
<cth@carlh.net>
Thu, 15 Nov 2018 21:57:07 +0000
(21:57 +0000)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 15 Nov 2018 21:57:07 +0000
(21:57 +0000)
src/cxml.cc
patch
|
blob
|
history
diff --git
a/src/cxml.cc
b/src/cxml.cc
index 3c2eda203bbf96f4aac476a8224e099885d69462..d3ec9e7fd95f6a27efa9a6eeae6543345cc57da9 100644
(file)
--- a/
src/cxml.cc
+++ b/
src/cxml.cc
@@
-43,7
+43,9
@@
cxml::Node::Node (xmlpp::Node* node)
string
cxml::Node::name () const
{
- assert (_node);
+ if (!_node) {
+ throw Error ("No node to read name from");
+ }
return _node->get_name ();
}
@@
-76,6
+78,9
@@
cxml::Node::optional_node_child (string name) const
list<shared_ptr<cxml::Node> >
cxml::Node::node_children () const
{
+ if (!_node) {
+ throw Error ("No node to read children from");
+ }
xmlpp::Node::NodeList c = _node->get_children ();
list<shared_ptr<cxml::Node> > n;