projects
/
libcxml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f29b074
)
Add check to avoid crash when the API is misused.
author
Carl Hetherington
<cth@carlh.net>
Sun, 2 Jul 2023 19:55:47 +0000
(21:55 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 2 Jul 2023 19:55:47 +0000
(21:55 +0200)
src/cxml.cc
patch
|
blob
|
history
diff --git
a/src/cxml.cc
b/src/cxml.cc
index e4435a2142d83a056ebfd2e2cef6dd0d5112379a..c2d85347d2a90cd893dc483439520b4826168989 100644
(file)
--- a/
src/cxml.cc
+++ b/
src/cxml.cc
@@
-98,6
+98,10
@@
cxml::Node::node_children (string name) const
how get_path works.
*/
+ if (!_node) {
+ throw cxml::Error("Node has no internal xmlpp node; did you forget to call a read method on cxml::Document?");
+ }
+
vector<shared_ptr<cxml::Node>> n;
for (auto i: _node->get_children()) {
if (i->get_name() == name) {